Exemplo n.º 1
0
    def execute(self) -> DefaultStat:
        total_stat = DefaultStat()

        for chain in get_all_chains():

            val = self.as_timed_result(
                lambda: self.import_empty_blocks(chain, self.num_blocks))
            stat = DefaultStat(caption=chain.get_vm().fork,
                               total_blocks=self.num_blocks,
                               total_seconds=val.duration)
            total_stat = total_stat.cumulate(stat)
            self.print_stat_line(stat)

        return total_stat
Exemplo n.º 2
0
    def execute(self) -> DefaultStat:
        total_stat = DefaultStat()

        for chain in get_all_chains():

            value = self.as_timed_result(
                lambda: self.mine_blocks(chain, self.num_blocks, self.num_tx))

            total_gas_used, total_num_tx = value.wrapped_value

            stat = DefaultStat(
                caption=chain.get_vm().fork,
                total_blocks=self.num_blocks,
                total_tx=total_num_tx,
                total_seconds=value.duration,
                total_gas=total_gas_used,
            )
            total_stat = total_stat.cumulate(stat)
            self.print_stat_line(stat)

        return total_stat
Exemplo n.º 3
0
    def execute(self) -> DefaultStat:
        total_stat = DefaultStat()
        for chain in get_all_chains():
            # Perform prepartions on the chain that do not count into the
            # benchmark time
            self._setup_benchmark(chain)

            # Perform the actual work that is measured
            value = self.as_timed_result(
                lambda: self.mine_blocks(chain, self.num_blocks, self.num_tx))
            total_gas_used, total_num_tx = value.wrapped_value
            stat = DefaultStat(
                caption=chain.get_vm().fork,
                total_blocks=self.num_blocks,
                total_tx=total_num_tx,
                total_seconds=value.duration,
                total_gas=total_gas_used,
            )
            total_stat = total_stat.cumulate(stat)
            self.print_stat_line(stat)
        return total_stat