Browse Source

Try melekes suggestion

pull/1962/head
ValarDragon 6 years ago
parent
commit
f04a087546
1 changed files with 6 additions and 15 deletions
  1. +6
    -15
      tools/tm-bench/main.go

+ 6
- 15
tools/tm-bench/main.go View File

@ -42,7 +42,7 @@ func main() {
fmt.Println(`Tendermint blockchain benchmarking tool. fmt.Println(`Tendermint blockchain benchmarking tool.
Usage: Usage:
tm-bench [-c 1] [-T 10] [-r 1000] [endpoints] [-output-format <plain|json> [-broadcast-tx-method <async|sync|commit>]]
tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] [-output-format <plain|json> [-broadcast-tx-method <async|sync|commit>]]
Examples: Examples:
tm-bench localhost:26657`) tm-bench localhost:26657`)
@ -93,10 +93,6 @@ Examples:
) )
logger.Info("Latest block height", "h", initialHeight) logger.Info("Latest block height", "h", initialHeight)
// record time start
timeStart := time.Now()
logger.Info("Time started", "t", timeStart)
transacters := startTransacters( transacters := startTransacters(
endpoints, endpoints,
connections, connections,
@ -104,6 +100,11 @@ Examples:
txSize, txSize,
"broadcast_tx_"+broadcastTxMethod, "broadcast_tx_"+broadcastTxMethod,
) )
// record time start
timeStart := time.Now()
logger.Info("Time last transacter started", "t", timeStart)
endTime := time.Duration(duration) * time.Second endTime := time.Duration(duration) * time.Second
<-time.After(endTime) <-time.After(endTime)
@ -190,16 +191,6 @@ func calculateStatistics(
offset = len(blockMetas) 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 ( var (
numBlocksPerSec = make(map[int64]int64) numBlocksPerSec = make(map[int64]int64)
numTxsPerSec = make(map[int64]int64) numTxsPerSec = make(map[int64]int64)


Loading…
Cancel
Save