@@ -244,6 +244,7 @@ pub struct TcpSendResult {
244244 pub duration : f32 ,
245245
246246 pub bytes_sent : u64 ,
247+ pub sends_blocked : u64 ,
247248}
248249impl TcpSendResult {
249250 fn from_json ( value : serde_json:: Value ) -> BoxResult < TcpSendResult > {
@@ -288,12 +289,16 @@ impl IntervalResult for TcpSendResult {
288289 false => format ! ( "megabytes/second: {:.3}" , bytes_per_second / 1_000_000.00 ) ,
289290 } ;
290291
291- format ! ( "----------\n \
292+ let mut output = format ! ( "----------\n \
292293 TCP send result over {:.2}s | stream: {}\n \
293294 bytes: {} | per second: {:.3} | {}",
294295 self . duration, self . stream_idx,
295296 self . bytes_sent, bytes_per_second, throughput,
296- )
297+ ) ;
298+ if self . sends_blocked > 0 {
299+ output. push_str ( & format ! ( "\n stalls due to full send-buffer: {}" , self . sends_blocked) ) ;
300+ }
301+ output
297302 }
298303}
299304
@@ -383,6 +388,7 @@ pub struct UdpSendResult {
383388
384389 pub bytes_sent : u64 ,
385390 pub packets_sent : u64 ,
391+ pub sends_blocked : u64 ,
386392}
387393impl UdpSendResult {
388394 fn from_json ( value : serde_json:: Value ) -> BoxResult < UdpSendResult > {
@@ -427,14 +433,18 @@ impl IntervalResult for UdpSendResult {
427433 false => format ! ( "megabytes/second: {:.3}" , bytes_per_second / 1_000_000.00 ) ,
428434 } ;
429435
430- format ! ( "----------\n \
436+ let mut output = format ! ( "----------\n \
431437 UDP send result over {:.2}s | stream: {}\n \
432438 bytes: {} | per second: {:.3} | {}\n \
433439 packets: {} per second: {:.3}",
434440 self . duration, self . stream_idx,
435441 self . bytes_sent, bytes_per_second, throughput,
436442 self . packets_sent, self . packets_sent as f32 / duration_divisor,
437- )
443+ ) ;
444+ if self . sends_blocked > 0 {
445+ output. push_str ( & format ! ( "\n stalls due to full send-buffer: {}" , self . sends_blocked) ) ;
446+ }
447+ output
438448 }
439449}
440450
0 commit comments