Skip to content

Commit

Permalink
rename metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed Sep 30, 2024
1 parent 38848d9 commit 7a02798
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 2 additions & 8 deletions quickwit/quickwit-janitor/src/actors/garbage_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,13 @@ impl GarbageCollector {
let deleted_file_entries = match gc_res {
Ok(removal_info) => {
self.counters.num_successful_gc_run += 1;
JANITOR_METRICS
.gc_run_count
.with_label_values(["success"])
.inc();
JANITOR_METRICS.gc_runs.with_label_values(["success"]).inc();
self.counters.num_failed_splits += removal_info.failed_splits.len();
removal_info.removed_split_entries
}
Err(error) => {
self.counters.num_failed_gc_run += 1;
JANITOR_METRICS
.gc_run_count
.with_label_values(["error"])
.inc();
JANITOR_METRICS.gc_runs.with_label_values(["error"]).inc();
error!(error=?error, "failed to run garbage collection");
return;
}
Expand Down
8 changes: 4 additions & 4 deletions quickwit/quickwit-janitor/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct JanitorMetrics {
pub ongoing_num_delete_operations_total: IntGaugeVec<1>,
pub gc_deleted_splits: IntCounterVec<1>,
pub gc_deleted_bytes: IntCounter,
pub gc_run_count: IntCounterVec<1>,
pub gc_runs: IntCounterVec<1>,
pub gc_seconds_total: IntCounter,
// TODO having a current run duration which is 0|undefined out of run, and returns `now -
// start_time` during a run would be nice
Expand All @@ -43,7 +43,7 @@ impl Default for JanitorMetrics {
["index"],
),
gc_deleted_splits: new_counter_vec(
"gc_deleted_splits_count",
"gc_deleted_splits_total",
"Total number of splits deleted by the garbage collector.",
"quickwit_janitor",
&[],
Expand All @@ -55,8 +55,8 @@ impl Default for JanitorMetrics {
"quickwit_janitor",
&[],
),
gc_run_count: new_counter_vec(
"gc_run_total",
gc_runs: new_counter_vec(
"gc_runs_total",
"Total number of garbage collector execition.",
"quickwit_janitor",
&[],
Expand Down

0 comments on commit 7a02798

Please sign in to comment.