Skip to content

Commit

Permalink
feat: putting block level dumping behind a verbosity check
Browse files Browse the repository at this point in the history
  • Loading branch information
praetoriansentry committed Dec 12, 2022
1 parent b2612d5 commit a0942aa
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cmd/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1474,16 +1474,19 @@ func printBlockSummary(bs map[uint64]blockSummary, startNonce, endNonce uint64)
if gasUsed == 0 {
blockUtilization = 0
}
_, _ = p.Printf("Block number: %v\tTime: %s\tGas Limit: %v\tGas Used: %v\tNum Tx: %v\tUtilization %v\tLatencies: %v\t%v\t%v\n",
number.Decimal(summary.Block.Number.ToUint64()),
time.Unix(summary.Block.Timestamp.ToInt64(), 0),
number.Decimal(summary.Block.GasLimit.ToUint64()),
number.Decimal(gasUsed),
number.Decimal(len(summary.Block.Transactions)),
number.Percent(blockUtilization),
number.Decimal(minLatency.Seconds()),
number.Decimal(medianLatency.Seconds()),
number.Decimal(maxLatency.Seconds()))
// if we're at trace, debug, or info level we'll output the block level metrics
if zerolog.GlobalLevel() <= zerolog.InfoLevel {
_, _ = p.Printf("Block number: %v\tTime: %s\tGas Limit: %v\tGas Used: %v\tNum Tx: %v\tUtilization %v\tLatencies: %v\t%v\t%v\n",
number.Decimal(summary.Block.Number.ToUint64()),
time.Unix(summary.Block.Timestamp.ToInt64(), 0),
number.Decimal(summary.Block.GasLimit.ToUint64()),
number.Decimal(gasUsed),
number.Decimal(len(summary.Block.Transactions)),
number.Percent(blockUtilization),
number.Decimal(minLatency.Seconds()),
number.Decimal(medianLatency.Seconds()),
number.Decimal(maxLatency.Seconds()))
}
totalTransactions += uint64(len(summary.Block.Transactions))
totalGasUsed += gasUsed
}
Expand Down

0 comments on commit a0942aa

Please sign in to comment.