Skip to content

Commit

Permalink
local drain: iterate logarithmically to produce histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksoj committed Jul 3, 2024
1 parent 0ab8945 commit 3b5d7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/metrics/local_drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub fn filter_histogram(hist: &Histogram<u32>) -> FilteredMetrics {
let mut count = 0;
let mut buckets = Vec::new();

for value in hist.iter_linear(10) {
for value in hist.iter_log(1, 2.0) {
count += value.count_since_last_iteration();

buckets.push(Bucket {
Expand Down Expand Up @@ -174,6 +174,7 @@ impl MetricsMap {
let mut filtered_metrics = BTreeMap::new();
for (name, metric) in to_filter {
filtered_metrics.insert(name.to_owned(), metric.to_filtered());

// convert time metrics to a histogram format, on top of percentiles
match metric {
AggregatedMetric::Time(ref hist) => {
Expand Down

0 comments on commit 3b5d7f7

Please sign in to comment.