From f04a0875465c74ad0e6ce35b92eb53eb9aeb716c Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Wed, 11 Jul 2018 21:54:46 -0700 Subject: [PATCH] Try melekes suggestion --- tools/tm-bench/main.go | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tools/tm-bench/main.go b/tools/tm-bench/main.go index f3d15f967..a9151404a 100644 --- a/tools/tm-bench/main.go +++ b/tools/tm-bench/main.go @@ -42,7 +42,7 @@ func main() { fmt.Println(`Tendermint blockchain benchmarking tool. Usage: - tm-bench [-c 1] [-T 10] [-r 1000] [endpoints] [-output-format [-broadcast-tx-method ]] + tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] [-output-format [-broadcast-tx-method ]] Examples: tm-bench localhost:26657`) @@ -93,10 +93,6 @@ Examples: ) logger.Info("Latest block height", "h", initialHeight) - // record time start - timeStart := time.Now() - logger.Info("Time started", "t", timeStart) - transacters := startTransacters( endpoints, connections, @@ -104,6 +100,11 @@ Examples: txSize, "broadcast_tx_"+broadcastTxMethod, ) + + // record time start + timeStart := time.Now() + logger.Info("Time last transacter started", "t", timeStart) + endTime := time.Duration(duration) * time.Second <-time.After(endTime) @@ -190,16 +191,6 @@ func calculateStatistics( offset = len(blockMetas) } - // Ignore the first block created if there were no txs in it, since we likely didn't begin - // sending txs by then. The last index is the block that was already present when we started - // this process - if blockMetas[len(blockMetas)-2].Header.NumTxs == 0 { - if timeStart.Before(blockMetas[len(blockMetas)-2].Header.Time) { - timeStart = blockMetas[len(blockMetas)-2].Header.Time - } - blockMetas = blockMetas[:len(blockMetas)-2] - } - var ( numBlocksPerSec = make(map[int64]int64) numTxsPerSec = make(map[int64]int64)