Skip to content

Commit

Permalink
fix: add health metric to drainer (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
dracarys18 authored Sep 22, 2023
1 parent 53c5c39 commit 4e8471b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/drainer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub async fn start_drainer(

let active_tasks = Arc::new(atomic::AtomicU64::new(0));
'event: loop {
metrics::DRAINER_HEALTH.add(&metrics::CONTEXT, 1, &[]);
match rx.try_recv() {
Err(mpsc::error::TryRecvError::Empty) => {
if utils::is_stream_available(stream_index, store.clone()).await {
Expand Down
1 change: 1 addition & 0 deletions crates/drainer/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ counter_metric!(ERRORS_WHILE_QUERY_EXECUTION, DRAINER_METER);
counter_metric!(SUCCESSFUL_QUERY_EXECUTION, DRAINER_METER);
counter_metric!(SHUTDOWN_SIGNAL_RECEIVED, DRAINER_METER);
counter_metric!(SUCCESSFUL_SHUTDOWN, DRAINER_METER);
counter_metric!(DRAINER_HEALTH, DRAINER_METER);

histogram_metric!(QUERY_EXECUTION_TIME, DRAINER_METER); // Time in (ms) milliseconds
histogram_metric!(REDIS_STREAM_READ_TIME, DRAINER_METER); // Time in (ms) milliseconds
Expand Down

0 comments on commit 4e8471b

Please sign in to comment.