Skip to content

Commit

Permalink
Add batcher_flush_size histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-cattermole committed May 14, 2024
1 parent bd16d65 commit dd73fc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion limitador/src/storage/redis/counters_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::storage::atomic_expiring_value::AtomicExpiringValue;
use crate::storage::redis::DEFAULT_MAX_CACHED_COUNTERS;
use dashmap::mapref::entry::Entry;
use dashmap::DashMap;
use metrics::gauge;
use metrics::{gauge, histogram};
use moka::sync::Cache;
use std::collections::HashMap;
use std::future::Future;
Expand Down Expand Up @@ -186,6 +186,7 @@ impl Batcher {
let value = self.updates.get(counter).unwrap().clone();
result.insert(counter.clone(), value);
}
histogram!("batcher_flush_size").record(result.len() as f64);
let result = consumer(result).await;
batch.iter().for_each(|counter| {
self.updates
Expand Down

0 comments on commit dd73fc3

Please sign in to comment.