Add CSV output to server mode
All checks were successful
CI / test (push) Successful in 1m26s

Server now writes a CSV row for each completed test with peer IP,
protocol, direction, duration, avg speeds, bytes, and lost packets.

Verified on loopback: TX 35 Gbps, RX 51 Gbps captured in CSV.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-01 10:19:15 +04:00
parent d19ad25a3c
commit 23db39a84e

View File

@@ -354,6 +354,12 @@ async fn handle_client(
&peer.to_string(), proto_str, dir_str, &peer.to_string(), proto_str, dir_str,
total_tx, total_rx, total_lost, intervals, total_tx, total_rx, total_lost, intervals,
); );
if crate::csv_output::is_enabled() {
crate::csv_output::write_result(
&peer.ip().to_string(), peer.port(), proto_str, dir_str,
intervals as u64, total_tx, total_rx, total_lost, auth_type,
);
}
result.map(|_| ()) result.map(|_| ())
} }