Skip to content

Commit

Permalink
Remove Counter/Add benchmark for delta temporality
Browse files Browse the repository at this point in the history
  • Loading branch information
fraillt committed Nov 7, 2024
1 parent ebf1bb6 commit 4149f0d
Showing 1 changed file with 1 addition and 51 deletions.
52 changes: 1 addition & 51 deletions opentelemetry-sdk/benches/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,14 @@ fn bench_counter(view: Option<Box<dyn View>>, temporality: &str) -> (SharedReade

fn counters(c: &mut Criterion) {
let (_, cntr) = bench_counter(None, "cumulative");
let (_, cntr2) = bench_counter(None, "delta");
// let (_, cntr2) = bench_counter(None, "delta");
let (_, cntr3) = bench_counter(None, "cumulative");

let mut group = c.benchmark_group("Counter");
group.bench_function("AddNoAttrs", |b| b.iter(|| cntr.add(1, &[])));
group.bench_function("AddNoAttrsDelta", |b| b.iter(|| cntr2.add(1, &[])));

group.bench_function("AddOneAttr", |b| {
b.iter(|| cntr.add(1, &[KeyValue::new("K", "V")]))
});
group.bench_function("AddOneAttrDelta", |b| {
b.iter(|| cntr2.add(1, &[KeyValue::new("K1", "V1")]))
});
group.bench_function("AddThreeAttr", |b| {
b.iter(|| {
cntr.add(
Expand All @@ -157,18 +152,6 @@ fn counters(c: &mut Criterion) {
)
})
});
group.bench_function("AddThreeAttrDelta", |b| {
b.iter(|| {
cntr2.add(
1,
&[
KeyValue::new("K2", "V2"),
KeyValue::new("K3", "V3"),
KeyValue::new("K4", "V4"),
],
)
})
});
group.bench_function("AddFiveAttr", |b| {
b.iter(|| {
cntr.add(
Expand All @@ -183,20 +166,6 @@ fn counters(c: &mut Criterion) {
)
})
});
group.bench_function("AddFiveAttrDelta", |b| {
b.iter(|| {
cntr2.add(
1,
&[
KeyValue::new("K5", "V5"),
KeyValue::new("K6", "V6"),
KeyValue::new("K7", "V7"),
KeyValue::new("K8", "V8"),
KeyValue::new("K9", "V9"),
],
)
})
});
group.bench_function("AddTenAttr", |b| {
b.iter(|| {
cntr.add(
Expand All @@ -216,25 +185,6 @@ fn counters(c: &mut Criterion) {
)
})
});
group.bench_function("AddTenAttrDelta", |b| {
b.iter(|| {
cntr2.add(
1,
&[
KeyValue::new("K10", "V10"),
KeyValue::new("K11", "V11"),
KeyValue::new("K12", "V12"),
KeyValue::new("K13", "V13"),
KeyValue::new("K14", "V14"),
KeyValue::new("K15", "V15"),
KeyValue::new("K16", "V16"),
KeyValue::new("K17", "V17"),
KeyValue::new("K18", "V18"),
KeyValue::new("K19", "V19"),
],
)
})
});

const MAX_DATA_POINTS: i64 = 2000;
let mut max_attributes: Vec<KeyValue> = Vec::new();
Expand Down

0 comments on commit 4149f0d

Please sign in to comment.