Skip to content

Commit 52f6d92

Browse files
authored
Remove Counter/Add benchmark for delta temporality (#2285)
1 parent ebf1bb6 commit 52f6d92

File tree

1 file changed

+5
-54
lines changed

1 file changed

+5
-54
lines changed

opentelemetry-sdk/benches/metric.rs

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,13 @@ fn bench_counter(view: Option<Box<dyn View>>, temporality: &str) -> (SharedReade
132132

133133
fn counters(c: &mut Criterion) {
134134
let (_, cntr) = bench_counter(None, "cumulative");
135-
let (_, cntr2) = bench_counter(None, "delta");
136-
let (_, cntr3) = bench_counter(None, "cumulative");
135+
let (_, cntr_max) = bench_counter(None, "cumulative");
137136

138137
let mut group = c.benchmark_group("Counter");
139138
group.bench_function("AddNoAttrs", |b| b.iter(|| cntr.add(1, &[])));
140-
group.bench_function("AddNoAttrsDelta", |b| b.iter(|| cntr2.add(1, &[])));
141-
142139
group.bench_function("AddOneAttr", |b| {
143140
b.iter(|| cntr.add(1, &[KeyValue::new("K", "V")]))
144141
});
145-
group.bench_function("AddOneAttrDelta", |b| {
146-
b.iter(|| cntr2.add(1, &[KeyValue::new("K1", "V1")]))
147-
});
148142
group.bench_function("AddThreeAttr", |b| {
149143
b.iter(|| {
150144
cntr.add(
@@ -157,18 +151,6 @@ fn counters(c: &mut Criterion) {
157151
)
158152
})
159153
});
160-
group.bench_function("AddThreeAttrDelta", |b| {
161-
b.iter(|| {
162-
cntr2.add(
163-
1,
164-
&[
165-
KeyValue::new("K2", "V2"),
166-
KeyValue::new("K3", "V3"),
167-
KeyValue::new("K4", "V4"),
168-
],
169-
)
170-
})
171-
});
172154
group.bench_function("AddFiveAttr", |b| {
173155
b.iter(|| {
174156
cntr.add(
@@ -183,20 +165,6 @@ fn counters(c: &mut Criterion) {
183165
)
184166
})
185167
});
186-
group.bench_function("AddFiveAttrDelta", |b| {
187-
b.iter(|| {
188-
cntr2.add(
189-
1,
190-
&[
191-
KeyValue::new("K5", "V5"),
192-
KeyValue::new("K6", "V6"),
193-
KeyValue::new("K7", "V7"),
194-
KeyValue::new("K8", "V8"),
195-
KeyValue::new("K9", "V9"),
196-
],
197-
)
198-
})
199-
});
200168
group.bench_function("AddTenAttr", |b| {
201169
b.iter(|| {
202170
cntr.add(
@@ -216,25 +184,6 @@ fn counters(c: &mut Criterion) {
216184
)
217185
})
218186
});
219-
group.bench_function("AddTenAttrDelta", |b| {
220-
b.iter(|| {
221-
cntr2.add(
222-
1,
223-
&[
224-
KeyValue::new("K10", "V10"),
225-
KeyValue::new("K11", "V11"),
226-
KeyValue::new("K12", "V12"),
227-
KeyValue::new("K13", "V13"),
228-
KeyValue::new("K14", "V14"),
229-
KeyValue::new("K15", "V15"),
230-
KeyValue::new("K16", "V16"),
231-
KeyValue::new("K17", "V17"),
232-
KeyValue::new("K18", "V18"),
233-
KeyValue::new("K19", "V19"),
234-
],
235-
)
236-
})
237-
});
238187

239188
const MAX_DATA_POINTS: i64 = 2000;
240189
let mut max_attributes: Vec<KeyValue> = Vec::new();
@@ -244,14 +193,16 @@ fn counters(c: &mut Criterion) {
244193
}
245194

246195
group.bench_function("AddOneTillMaxAttr", |b| {
247-
b.iter(|| cntr3.add(1, &max_attributes))
196+
b.iter(|| cntr_max.add(1, &max_attributes))
248197
});
249198

250199
for i in MAX_DATA_POINTS..MAX_DATA_POINTS * 2 {
251200
max_attributes.push(KeyValue::new(i.to_string(), i))
252201
}
253202

254-
group.bench_function("AddMaxAttr", |b| b.iter(|| cntr3.add(1, &max_attributes)));
203+
group.bench_function("AddMaxAttr", |b| {
204+
b.iter(|| cntr_max.add(1, &max_attributes))
205+
});
255206

256207
group.bench_function("AddInvalidAttr", |b| {
257208
b.iter(|| cntr.add(1, &[KeyValue::new("", "V"), KeyValue::new("K", "V")]))

0 commit comments

Comments
 (0)