Skip to content

Commit

Permalink
try out sampling mode changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bantonsson committed Jul 9, 2024
1 parent b630e91 commit d18d238
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions trace-obfuscation/benches/benchmarks/sql_obfuscation_bench.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

use criterion::{black_box, criterion_group, Criterion};
use criterion::{black_box, criterion_group, Criterion, SamplingMode};
use datadog_trace_obfuscation::sql::obfuscate_sql_string;

fn sql_obfuscation(c: &mut Criterion) {
let mut group = c.benchmark_group("sql");
group.bench_function("obfuscate_sql_string", |b| {
b.iter(|| {
for (input, _) in CASES {
black_box(obfuscate_sql_string(input));
}
})
});
group
.sampling_mode(SamplingMode::Flat)
.bench_function("obfuscate_sql_string", |b| {
b.iter(|| {
for (input, _) in CASES {
black_box(obfuscate_sql_string(input));
}
})
});
}

criterion_group!(benches, sql_obfuscation);
Expand Down

0 comments on commit d18d238

Please sign in to comment.