Skip to content

Commit

Permalink
Fix stats
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Dec 12, 2024
1 parent c5ba11e commit ee9f0a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion io/zenoh-transport/src/common/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,14 @@ impl Encode<&TransportMessage> for &mut WBatch {

fn encode(self, x: &TransportMessage) -> Self::Output {
let mut writer = self.buffer.writer();
self.codec.write(&mut writer, x)
let res = self.codec.write(&mut writer, x);
#[cfg(feature = "stats")]
{
if let Ok(()) = res {
self.stats.t_msgs += 1;
}
}
res
}
}

Expand Down

0 comments on commit ee9f0a5

Please sign in to comment.