File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " rperf"
3- version = " 0.1.6 "
3+ version = " 0.1.7 "
44description = " validates network throughput capacity and reliability"
55authors = [" Neil Tallim <neiltallim@3d-p.com>" ]
6- edition = " 2018 "
6+ edition = " 2021 "
77repository = " https://github.com/opensource-3d-p/rperf"
88license = " GPLv3"
99keywords = [" network" , " performance" , " tcp" , " udp" ]
Original file line number Diff line number Diff line change @@ -506,6 +506,7 @@ pub mod sender {
506506 impl super :: TestStream for UdpSender {
507507 fn run_interval ( & mut self ) -> Option < super :: BoxResult < Box < dyn super :: IntervalResult + Sync + Send > > > {
508508 let interval_duration = Duration :: from_secs_f32 ( self . send_interval ) ;
509+ let mut interval_iteration = 0 ;
509510 let bytes_to_send = ( ( self . test_definition . bandwidth as f32 ) * super :: INTERVAL . as_secs_f32 ( ) ) as i64 ;
510511 let mut bytes_to_send_remaining = bytes_to_send;
511512 let bytes_to_send_per_interval_slice = ( ( bytes_to_send as f32 ) * self . send_interval ) as i64 ;
@@ -563,10 +564,12 @@ pub mod sender {
563564 sleep ( super :: INTERVAL - elapsed_time) ;
564565 }
565566 } else if bytes_to_send_per_interval_slice_remaining <= 0 { // interval subsection exhausted
567+ interval_iteration += 1 ;
566568 bytes_to_send_per_interval_slice_remaining = bytes_to_send_per_interval_slice;
567569 let elapsed_time = cycle_start. elapsed ( ) ;
568- if interval_duration > elapsed_time {
569- sleep ( interval_duration - elapsed_time) ;
570+ let interval_endtime = interval_iteration * interval_duration;
571+ if interval_endtime > elapsed_time {
572+ sleep ( interval_endtime - elapsed_time) ;
570573 }
571574 }
572575 self . remaining_duration -= packet_start. elapsed ( ) . as_secs_f32 ( ) ;
You can’t perform that action at this time.
0 commit comments