Move recv timer to start before crossbream receiver recv_timeout() (#642)

The timer starting after recv_timeout() means the measured time will NOT
include time spent waiting for the first PacketBatch from the receiver.
This commit is contained in:
steviez 2024-04-08 11:28:00 -05:00 committed by GitHub
parent 0025ecd5af
commit 923e303acb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -361,9 +361,9 @@ fn recv_send(
pub fn recv_packet_batches(
recvr: &PacketBatchReceiver,
) -> Result<(Vec<PacketBatch>, usize, Duration)> {
let recv_start = Instant::now();
let timer = Duration::new(1, 0);
let packet_batch = recvr.recv_timeout(timer)?;
let recv_start = Instant::now();
trace!("got packets");
let mut num_packets = packet_batch.len();
let mut packet_batches = vec![packet_batch];