Skip to content

Commit

Permalink
fix(913): using 2+batch.len() when increasing rx_bytes (#914)
Browse files Browse the repository at this point in the history
* fix(913): using 2+batch.len() when increasing rx_bytes

Signed-off-by: gabrik <[email protected]>

* chore: format

Signed-off-by: gabrik <[email protected]>

---------

Signed-off-by: gabrik <[email protected]>
  • Loading branch information
gabrik authored Apr 8, 2024
1 parent b2ef3dd commit 0926dd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion io/zenoh-transport/src/unicast/universal/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ async fn rx_task(
let batch = batch.map_err(|_| zerror!("{}: expired after {} milliseconds", link, lease.as_millis()))??;
#[cfg(feature = "stats")]
{
transport.stats.inc_rx_bytes(2 + n); // Account for the batch len encoding (16 bits)

transport.stats.inc_rx_bytes(2 + batch.len()); // Account for the batch len encoding (16 bits)
}
transport.read_messages(batch, &l)?;
}
Expand Down

0 comments on commit 0926dd3

Please sign in to comment.