Skip to content

Commit

Permalink
make benchmarks work
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz committed Nov 25, 2023
1 parent d0e5c0a commit fc7dc04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metrics/benches/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ fn macro_benchmark(c: &mut Criterion) {
})
});
group.bench_function("global_initialized/no_labels", |b| {
metrics::set_global_recorder(TestRecorder::default()).unwrap();
let _ = metrics::set_global_recorder(TestRecorder::default());
b.iter(|| {
counter!("counter_bench").increment(42);
});
});
group.bench_function("global_initialized/with_static_labels", |b| {
metrics::set_global_recorder(TestRecorder::default()).unwrap();
let _ = metrics::set_global_recorder(TestRecorder::default());
b.iter(|| {
counter!("counter_bench", "request" => "http", "svc" => "admin").increment(42);
});
});
group.bench_function("global_initialized/with_dynamic_labels", |b| {
metrics::set_global_recorder(TestRecorder::default()).unwrap();
let _ = metrics::set_global_recorder(TestRecorder::default());

let label_val = thread_rng().gen::<u64>().to_string();
b.iter(move || {
Expand Down

0 comments on commit fc7dc04

Please sign in to comment.