Skip to content

Commit

Permalink
Added a warning when sends are blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
flan committed Sep 23, 2022
1 parent 17990ea commit 14d3826
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/protocol/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ impl TestResults for TcpTestResults {
let mut duration_receive:f64 = 0.0;
let mut bytes_received:u64 = 0;

let mut sends_blocked = false;

for (stream_idx, stream) in self.stream_results.values().enumerate() {
for (i, sr) in stream.send_results.iter().enumerate() {
Expand All @@ -835,6 +836,8 @@ impl TestResults for TcpTestResults {
stream_send_durations[stream_idx] += sr.duration as f64;

bytes_sent += sr.bytes_sent;

sends_blocked |= sr.sends_blocked > 0;
}

for (i, rr) in stream.receive_results.iter().enumerate() {
Expand Down Expand Up @@ -899,6 +902,9 @@ impl TestResults for TcpTestResults {
receive_bytes_per_second, receive_throughput,
bytes_received, receive_bytes_per_second * stream_count as f64, total_receive_throughput,
);
if sends_blocked {
output.push_str(&format!("\nthroughput throttled by buffer limitations"));
}
if !self.is_success() {
output.push_str(&format!("\nTESTING DID NOT COMPLETE SUCCESSFULLY"));
}
Expand Down Expand Up @@ -1097,6 +1103,7 @@ impl TestResults for UdpTestResults {
let mut unbroken_sequence_count:u64 = 0;
let mut jitter_weight:f64 = 0.0;

let mut sends_blocked = false;

for (stream_idx, stream) in self.stream_results.values().enumerate() {
for (i, sr) in stream.send_results.iter().enumerate() {
Expand All @@ -1109,6 +1116,8 @@ impl TestResults for UdpTestResults {

bytes_sent += sr.bytes_sent;
packets_sent += sr.packets_sent;

sends_blocked |= sr.sends_blocked > 0;
}

for (i, rr) in stream.receive_results.iter().enumerate() {
Expand Down Expand Up @@ -1197,6 +1206,9 @@ impl TestResults for UdpTestResults {
if jitter_calculated {
output.push_str(&format!("\njitter: {:.6}s over {} consecutive packets", jitter_weight / (unbroken_sequence_count as f64), unbroken_sequence_count));
}
if sends_blocked {
output.push_str(&format!("\nthroughput throttled by buffer limitations"));
}
if !self.is_success() {
output.push_str(&format!("\nTESTING DID NOT COMPLETE SUCCESSFULLY"));
}
Expand Down

0 comments on commit 14d3826

Please sign in to comment.