Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(spooler): Clean up unused metrics #4035

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions relay-server/src/services/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,45 +143,17 @@ impl EnvelopeBufferService {
&mut self,
buffer: &mut PolymorphicEnvelopeBuffer,
) -> Result<(), SendError> {
relay_statsd::metric!(
counter(RelayCounters::BufferReadyToPop) += 1,
status = "checking"
);

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;
}

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

Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl StackProvider for SqliteStackProvider {
async fn flush(&mut self, envelope_stacks: impl IntoIterator<Item = Self::Stack>) {
relay_log::trace!("Flushing sqlite envelope buffer");

relay_statsd::metric!(timer(RelayTimers::BufferDrain), {
relay_statsd::metric!(timer(RelayTimers::BufferFlush), {
let mut envelopes = Vec::with_capacity(self.drain_batch_size);
for envelope_stack in envelope_stacks {
for envelope in envelope_stack.flush() {
Expand Down
9 changes: 3 additions & 6 deletions relay-server/src/statsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ pub enum RelayTimers {
BufferPeek,
/// Timing in milliseconds for the time it takes for the buffer to pop.
BufferPop,
/// Timing in milliseconds for the time it takes for the buffer to drain its envelopes.
BufferDrain,
/// Timing in milliseconds for the time it takes for the buffer to flush its envelopes.
BufferFlush,
}

impl TimerMetric for RelayTimers {
Expand Down Expand Up @@ -579,7 +579,7 @@ impl TimerMetric for RelayTimers {
RelayTimers::BufferPush => "buffer.push.duration",
RelayTimers::BufferPeek => "buffer.peek.duration",
RelayTimers::BufferPop => "buffer.pop.duration",
RelayTimers::BufferDrain => "buffer.drain.duration",
RelayTimers::BufferFlush => "buffer.flush.duration",
}
}
}
Expand Down Expand Up @@ -635,8 +635,6 @@ pub enum RelayCounters {
BufferEnvelopeStacksPopped,
/// Number of times an envelope from the buffer is trying to be popped.
BufferTryPop,
/// Number of times the readiness check of the buffer is polled.
BufferReadyToPop,
/// Number of envelopes spool to disk.
BufferSpooledEnvelopes,
/// Number of envelopes unspooled from disk.
Expand Down Expand Up @@ -860,7 +858,6 @@ impl CounterMetric for RelayCounters {
RelayCounters::BufferStateTransition => "buffer.state.transition",
RelayCounters::BufferEnvelopeStacksPopped => "buffer.envelope_stacks_popped",
RelayCounters::BufferTryPop => "buffer.try_pop",
RelayCounters::BufferReadyToPop => "buffer.ready_to_pop",
RelayCounters::BufferSpooledEnvelopes => "buffer.spooled_envelopes",
RelayCounters::BufferUnspooledEnvelopes => "buffer.unspooled_envelopes",
RelayCounters::Outcomes => "events.outcomes",
Expand Down
Loading