Skip to content

Commit

Permalink
instr(buffer): More temporary metrics around dequeue (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbayer authored Sep 13, 2024
1 parent c08c634 commit 5d351d5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions relay-server/src/services/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,31 @@ impl EnvelopeBufferService {
);

self.system_ready(buffer).await;

relay_statsd::metric!(
counter(RelayCounters::BufferReadyToPop) += 1,
status = "system_ready"
);

if self.sleep > Duration::ZERO {
tokio::time::sleep(self.sleep).await;
}

relay_statsd::metric!(
counter(RelayCounters::BufferReadyToPop) += 1,
status = "slept"
);

if let Some(project_cache_ready) = self.project_cache_ready.as_mut() {
relay_statsd::metric!(
counter(RelayCounters::BufferReadyToPop) += 1,
status = "waiting_for_project_cache"
);
project_cache_ready.await?;
relay_statsd::metric!(
counter(RelayCounters::BufferReadyToPop) += 1,
status = "waited_for_project_cache"
);
self.project_cache_ready = None;
}

Expand Down

0 comments on commit 5d351d5

Please sign in to comment.