diff --git a/crates/fluvio-benchmark/src/stats_collector.rs b/crates/fluvio-benchmark/src/stats_collector.rs index fcd51a2249..52acb5d807 100644 --- a/crates/fluvio-benchmark/src/stats_collector.rs +++ b/crates/fluvio-benchmark/src/stats_collector.rs @@ -213,7 +213,6 @@ impl StatCollector { record_bytes: 0, latency: 0, }; - let mut window = 0; let mut latencies_histogram = hdrhistogram::Histogram::::new(3).expect("new histogram"); @@ -236,7 +235,7 @@ impl StatCollector { central_stats.latency += stats.latency; latencies_histogram.record(stats.latency).expect("record"); - if elapsed.as_secs() >= 1 { + if elapsed.as_secs() >= 5 { let latency_avg = latencies_histogram.mean() as u64; let latency_max = latencies_histogram.value_at_quantile(1.0); let records_per_sec = @@ -263,35 +262,11 @@ impl StatCollector { }; latencies_histogram = hdrhistogram::Histogram::::new(3).expect("new histogram"); - window += 1; } } } _ = end_broadcast.recv() => { - if window == 0 { - break; - } - - let latency_avg = latencies_histogram.mean() as u64; - let latency_max = latencies_histogram.value_at_quantile(1.0); - let elapsed = instant.elapsed(); - let elapsed_seconds = elapsed.as_millis() as f64 / 1000.0; - let records_per_sec = - (central_stats.record_send as f64 / elapsed_seconds).round() as u64; - let bytes_per_sec = - (central_stats.record_bytes as f64 / elapsed_seconds).round() as u64; - - let _ = stats_sender - .send(Stats { - record_send: central_stats.record_send, - record_bytes: central_stats.record_bytes, - records_per_sec, - bytes_per_sec, - latency_avg, - latency_max, - }) - .await; - break; + break } } }