Skip to content

Commit

Permalink
Properly track the backend bytes out metric in Pipe
Browse files Browse the repository at this point in the history
Signed-off-by: Eloi DEMOLIS <eloi.demolis@clever-cloud.com>
  • Loading branch information
Wonshtrum committed Aug 27, 2024
1 parent 44f76c3 commit 5ab35c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/protocol/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L> {
if self.frontend_buffer.available_data() == 0 {
self.frontend_readiness.interest.insert(Ready::READABLE);
self.backend_readiness.interest.remove(Ready::WRITABLE);
count!("back_bytes_out", sz as i64);
metrics.backend_bout += sz;
return SessionResult::Continue;
}

Expand All @@ -531,6 +533,7 @@ impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L> {
}
}

count!("back_bytes_out", sz as i64);
metrics.backend_bout += sz;

if !self.check_connections() {
Expand Down

0 comments on commit 5ab35c2

Please sign in to comment.