Skip to content

Commit 5eb0601

Browse files
stdout: reverse output of negative bucket
1 parent 8628839 commit 5eb0601

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

opentelemetry-stdout/src/metrics/exporter.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,17 @@ fn print_exponential_hist_data_points<'a, T: Debug + Copy + 'a>(
317317
let negative_bucket = data_point.negative_bucket();
318318
let negative_offset = negative_bucket.offset();
319319
println!("\t\t\tNegativeOffset : {}", negative_offset);
320-
for (i, count) in negative_bucket.counts().enumerate() {
320+
for (i, count) in negative_bucket
321+
.counts()
322+
.collect::<Vec<_>>()
323+
.into_iter()
324+
.enumerate()
325+
.rev()
326+
{
321327
let from = -base.powf(i as f64 + negative_offset as f64);
322328
let to = -base.powf(i as f64 + negative_offset as f64 + 1.0f64);
323329
println!(
324-
"\t\t\t\t -> Bucket {} (> {:.3} to <= {:.3}) : {}",
330+
"\t\t\t\t -> Bucket {} (<= {:.3} to > {:.3}) : {}",
325331
i, from, to, count
326332
);
327333
}

0 commit comments

Comments
 (0)