From ae111a131cf9f4dccecd88665c4098c62d40a4c2 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 5 Aug 2018 22:53:37 -0700 Subject: [PATCH] Condense stdout --- src/bin/bench-tps.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/bench-tps.rs b/src/bin/bench-tps.rs index 3e7dcac150..f1060ec394 100644 --- a/src/bin/bench-tps.rs +++ b/src/bin/bench-tps.rs @@ -78,19 +78,21 @@ fn sample_tx_count( now = Instant::now(); let sample = tx_count - initial_tx_count; initial_tx_count = tx_count; - println!("{} Transactions processed {}", log_prefix, sample); + let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos()); let tps = (sample * 1_000_000_000) as f64 / ns as f64; if tps > max_tps { max_tps = tps; } - println!("{} {:.2} TPS", log_prefix, tps); if tx_count > first_tx_count { total = tx_count - first_tx_count; } else { total = 0; } - println!("{} Total transactions processed {}", log_prefix, total); + println!( + "{} {:9.2} TPS, Transactions: {:6}, Total transactions: {}", + log_prefix, tps, sample, total + ); sleep(Duration::new(sample_period, 0)); if exit_signal.load(Ordering::Relaxed) {