pageserver: add deletion queue submitted/executed metrics

This commit is contained in:
John Spray
2023-08-14 14:59:26 +01:00
parent e0bed0732c
commit 54ec7919b8
2 changed files with 19 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
use crate::metrics::{DELETION_QUEUE_EXECUTED, DELETION_QUEUE_SUBMITTED};
use remote_storage::{GenericRemoteStorage, RemotePath};
use serde::Deserialize;
use serde::Serialize;
@@ -137,6 +138,7 @@ impl DeletionQueueClient {
timeline_id: TimelineId,
layers: Vec<LayerFileName>,
) {
DELETION_QUEUE_SUBMITTED.inc_by(layers.len() as u64);
self.do_push(FrontendQueueMessage::Delete(DeletionOp {
tenant_id,
timeline_id,
@@ -191,6 +193,7 @@ impl BackendQueueWorker {
async fn maybe_execute(&mut self) {
match self.remote_storage.delete_objects(&self.accumulator).await {
Ok(()) => {
DELETION_QUEUE_EXECUTED.inc_by(self.accumulator.len() as u64);
self.accumulator.clear();
self.executed_lists.append(&mut self.pending_lists);
}

View File

@@ -658,6 +658,22 @@ static REMOTE_TIMELINE_CLIENT_CALLS_STARTED_HIST: Lazy<HistogramVec> = Lazy::new
.expect("failed to define a metric")
});
pub(crate) static DELETION_QUEUE_SUBMITTED: Lazy<IntCounter> = Lazy::new(|| {
register_int_counter!(
"pageserver_deletion_queue_submitted",
"Number of objects submitted for deletion"
)
.expect("failed to define a metric")
});
pub(crate) static DELETION_QUEUE_EXECUTED: Lazy<IntCounter> = Lazy::new(|| {
register_int_counter!(
"pageserver_deletion_queue_executed",
"Number of objects deleted"
)
.expect("failed to define a metric")
});
static REMOTE_TIMELINE_CLIENT_BYTES_STARTED_COUNTER: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"pageserver_remote_timeline_client_bytes_started",