Skip to content

Commit b8c8f52

Browse files
committed
fix: only count successful writes
1 parent b19090e commit b8c8f52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

process/src/monitor.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@ impl<M: MessageBounds> MessageBus<M> for MonitorBus<M> {
172172
.pending_since = Some(Instant::now());
173173
let res = self.inner.publish(topic, message).await;
174174
let mut writes = self.state.writes.entry(topic.to_string()).or_default();
175-
writes.written += 1;
176175
writes.pending_since = None;
177-
*self.stream_writes.entry(topic.to_string()).or_default() += 1;
176+
if res.is_ok() {
177+
writes.written += 1;
178+
*self.stream_writes.entry(topic.to_string()).or_default() += 1;
179+
}
178180
res
179181
}
180182

0 commit comments

Comments
 (0)