Skip to content

Commit d191213

Browse files
committed
fix: Use fully verbose throughput field names per review
Rename average_throughput_mb_s → average_throughput_megabytes_per_sec and peak_throughput_mb_s → peak_throughput_megabytes_per_sec for unambiguous field naming in serialized output. AI-assisted-by: Claude Opus 4 (Cursor agent) Made-with: Cursor
1 parent 3176fd9 commit d191213

3 files changed

Lines changed: 30 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ The benchmark generates comprehensive JSON output with the following structure:
658658
"summary": {
659659
"total_messages_sent": 10000,
660660
"total_bytes_transferred": 10240000,
661-
"average_throughput_mb_s": 305.17,
661+
"average_throughput_megabytes_per_sec": 305.17,
662662
"p95_latency_ns": 5200,
663663
"p99_latency_ns": 8500
664664
}

src/results.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,10 @@ pub struct BenchmarkSummary {
369369
pub total_bytes_transferred: usize,
370370

371371
/// Average throughput across all tests in megabytes per second (MB/s)
372-
pub average_throughput_mb_s: f64,
372+
pub average_throughput_megabytes_per_sec: f64,
373373

374374
/// Peak throughput observed in any single test in megabytes per second (MB/s)
375-
pub peak_throughput_mb_s: f64,
375+
pub peak_throughput_megabytes_per_sec: f64,
376376

377377
/// Average latency across all latency measurements (if any)
378378
pub average_latency_ns: Option<f64>,
@@ -1133,7 +1133,9 @@ impl ResultsManager {
11331133
result.mechanism.to_string(),
11341134
MechanismSummary {
11351135
mechanism: result.mechanism,
1136-
average_throughput_mb_s: result.summary.average_throughput_mb_s,
1136+
average_throughput_megabytes_per_sec: result
1137+
.summary
1138+
.average_throughput_megabytes_per_sec,
11371139
p95_latency_ns: result.summary.p95_latency_ns,
11381140
p99_latency_ns: result.summary.p99_latency_ns,
11391141
total_messages: result.summary.total_messages_sent,
@@ -1171,8 +1173,8 @@ impl ResultsManager {
11711173
.iter()
11721174
.max_by(|a, b| {
11731175
a.summary
1174-
.average_throughput_mb_s
1175-
.partial_cmp(&b.summary.average_throughput_mb_s)
1176+
.average_throughput_megabytes_per_sec
1177+
.partial_cmp(&b.summary.average_throughput_megabytes_per_sec)
11761178
.unwrap()
11771179
})
11781180
.map(|result| result.mechanism.to_string())
@@ -1382,7 +1384,10 @@ impl ResultsManager {
13821384
println!("{}Throughput:", indent);
13831385
println!(
13841386
"{}{:<8} Average: {:.2} MB/s, Peak: {:.2} MB/s",
1385-
indent, " ", summary.average_throughput_mb_s, summary.peak_throughput_mb_s
1387+
indent,
1388+
" ",
1389+
summary.average_throughput_megabytes_per_sec,
1390+
summary.peak_throughput_megabytes_per_sec
13861391
);
13871392

13881393
println!("{}Totals:", indent);
@@ -1524,7 +1529,7 @@ pub struct MechanismSummary {
15241529
pub mechanism: IpcMechanism,
15251530

15261531
/// Average throughput performance in megabytes per second (MB/s)
1527-
pub average_throughput_mb_s: f64,
1532+
pub average_throughput_megabytes_per_sec: f64,
15281533

15291534
/// 95th percentile latency (if latency was measured)
15301535
pub p95_latency_ns: Option<u64>,
@@ -1689,9 +1694,9 @@ impl BenchmarkResults {
16891694
}
16901695

16911696
// Calculate summary metrics
1692-
let average_throughput_mb_s =
1697+
let average_throughput_megabytes_per_sec =
16931698
throughput_values.iter().sum::<f64>() / throughput_values.len() as f64 / 1_000_000.0;
1694-
let peak_throughput_mb_s =
1699+
let peak_throughput_megabytes_per_sec =
16951700
throughput_values.iter().cloned().fold(0.0, f64::max) / 1_000_000.0;
16961701

16971702
// Calculate properly weighted average latency across all test types
@@ -1703,8 +1708,8 @@ impl BenchmarkResults {
17031708
self.summary = BenchmarkSummary {
17041709
total_messages_sent: total_messages,
17051710
total_bytes_transferred: total_bytes,
1706-
average_throughput_mb_s,
1707-
peak_throughput_mb_s,
1711+
average_throughput_megabytes_per_sec,
1712+
peak_throughput_megabytes_per_sec,
17081713
average_latency_ns,
17091714
min_latency_ns,
17101715
max_latency_ns,
@@ -1849,8 +1854,8 @@ impl Default for BenchmarkSummary {
18491854
Self {
18501855
total_messages_sent: 0,
18511856
total_bytes_transferred: 0,
1852-
average_throughput_mb_s: 0.0,
1853-
peak_throughput_mb_s: 0.0,
1857+
average_throughput_megabytes_per_sec: 0.0,
1858+
peak_throughput_megabytes_per_sec: 0.0,
18541859
average_latency_ns: None,
18551860
min_latency_ns: None,
18561861
max_latency_ns: None,

src/results_blocking.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,9 @@ impl BlockingResultsManager {
10051005
result.mechanism.to_string(),
10061006
MechanismSummary {
10071007
mechanism: result.mechanism,
1008-
average_throughput_mb_s: result.summary.average_throughput_mb_s,
1008+
average_throughput_megabytes_per_sec: result
1009+
.summary
1010+
.average_throughput_megabytes_per_sec,
10091011
p95_latency_ns: result.summary.p95_latency_ns,
10101012
p99_latency_ns: result.summary.p99_latency_ns,
10111013
total_messages: result.summary.total_messages_sent,
@@ -1043,8 +1045,8 @@ impl BlockingResultsManager {
10431045
.iter()
10441046
.max_by(|a, b| {
10451047
a.summary
1046-
.average_throughput_mb_s
1047-
.partial_cmp(&b.summary.average_throughput_mb_s)
1048+
.average_throughput_megabytes_per_sec
1049+
.partial_cmp(&b.summary.average_throughput_megabytes_per_sec)
10481050
.unwrap()
10491051
})
10501052
.map(|result| result.mechanism.to_string())
@@ -1263,7 +1265,10 @@ impl BlockingResultsManager {
12631265
println!("{}Throughput:", indent);
12641266
println!(
12651267
"{}{:<8} Average: {:.2} MB/s, Peak: {:.2} MB/s",
1266-
indent, " ", summary.average_throughput_mb_s, summary.peak_throughput_mb_s
1268+
indent,
1269+
" ",
1270+
summary.average_throughput_megabytes_per_sec,
1271+
summary.peak_throughput_megabytes_per_sec
12671272
);
12681273

12691274
println!("{}Totals:", indent);
@@ -2189,7 +2194,7 @@ mod tests {
21892194

21902195
// Add results with different throughputs
21912196
let mut results1 = create_test_results();
2192-
results1.summary.average_throughput_mb_s = 100.0;
2197+
results1.summary.average_throughput_megabytes_per_sec = 100.0;
21932198
manager.add_results(results1).unwrap();
21942199

21952200
// Create a second result with higher throughput
@@ -2204,7 +2209,7 @@ mod tests {
22042209
true,
22052210
true,
22062211
);
2207-
results2.summary.average_throughput_mb_s = 200.0; // Higher
2212+
results2.summary.average_throughput_megabytes_per_sec = 200.0; // Higher
22082213
manager.add_results(results2).unwrap();
22092214

22102215
// The fastest should be SharedMemory

0 commit comments

Comments
 (0)