Skip to content

Commit

Permalink
chore: change unit to seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
dracarys18 committed Dec 1, 2023
1 parent c8e16d7 commit 1121845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/drainer/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ histogram_metric!(QUERY_EXECUTION_TIME, DRAINER_METER); // Time in (ms) millisec
histogram_metric!(REDIS_STREAM_READ_TIME, DRAINER_METER); // Time in (ms) milliseconds
histogram_metric!(REDIS_STREAM_TRIM_TIME, DRAINER_METER); // Time in (ms) milliseconds
histogram_metric!(CLEANUP_TIME, DRAINER_METER); // Time in (ms) milliseconds
histogram_metric_i64!(DRAINER_DELAY_MS, DRAINER_METER); // Time in (ms) milliseconds
histogram_metric_i64!(DRAINER_DELAY_SECONDS, DRAINER_METER); // Time in (s) seconds
8 changes: 5 additions & 3 deletions crates/drainer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ pub fn push_drainer_delay(pushed_at: Option<&String>, operation: String) {
if let Some(pushed_at) = pushed_at {
if let Ok(time) = pushed_at.parse::<i64>() {
let drained_at = common_utils::date_time::now_unix_timestamp();
let delay_ms = (drained_at - time) * 1000;
metrics::DRAINER_DELAY_MS.record(
let delay = drained_at - time;

logger::debug!(operation = operation, delay = delay);
metrics::DRAINER_DELAY_SECONDS.record(
&metrics::CONTEXT,
delay_ms,
delay,
&[metrics::KeyValue {
key: "operation".into(),
value: operation.into(),
Expand Down

0 comments on commit 1121845

Please sign in to comment.