Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
fix incorrect histogram size
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Nov 26, 2023
1 parent f93c4cf commit cc499c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,15 @@ impl SumHistogram {
push_bucket(current_bucket_value);
}

let histogram_size = duration_from_nanos(bucket_size * buckets.len() as u128);
let bucket_size = duration_from_nanos(bucket_size);

Histogram {
value_range: bucket_min..bucket_max,
timestamp_range: {
let start = Timestamp::new(duration_from_nanos(bucket_start)).unwrap();

start..start + bucket_size
start..start + histogram_size
},
bucket_size,
buckets,
Expand Down

0 comments on commit cc499c3

Please sign in to comment.