Skip to content

Commit 7d7d807

Browse files
authored
fix: complete alloc_tracker 0.6.0 API migration in benches
1 parent bb12052 commit 7d7d807

15 files changed

Lines changed: 29 additions & 29 deletions

File tree

crates/bytesbuf/benches/buf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const MANY_SPANS: usize = 32;
3232

3333
#[expect(clippy::too_many_lines, reason = "Is fine - lots of benchmarks to do!")]
3434
fn entrypoint(c: &mut Criterion) {
35-
let allocs = Session::new();
35+
let allocs = Session::new().no_stdout().no_file();
3636

3737
let memory = TransparentMemory::new();
3838

@@ -342,5 +342,5 @@ fn entrypoint(c: &mut Criterion) {
342342

343343
group.finish();
344344

345-
allocs.print_to_stdout();
345+
allocs.to_report().print_to_stdout();
346346
}

crates/bytesbuf/benches/bytesbuf_vs_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const WORKING_SLICE_LEN: usize = 256;
3434

3535
#[expect(clippy::too_many_lines, reason = "Is fine - lots of benchmarks to do!")]
3636
fn entrypoint(c: &mut Criterion) {
37-
let allocs = Session::new();
37+
let allocs = Session::new().no_stdout().no_file();
3838

3939
let memory = TransparentMemory::new();
4040

@@ -747,5 +747,5 @@ fn entrypoint(c: &mut Criterion) {
747747

748748
group.finish();
749749

750-
allocs.print_to_stdout();
750+
allocs.to_report().print_to_stdout();
751751
}

crates/bytesbuf/benches/global_pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ONE_MB: usize = 1024 * 1024;
2121
const TINY: usize = 128;
2222

2323
fn entrypoint(c: &mut Criterion) {
24-
let allocs = Session::new();
24+
let allocs = Session::new().no_stdout().no_file();
2525

2626
let warm_memory = GlobalPool::new();
2727

@@ -115,5 +115,5 @@ fn entrypoint(c: &mut Criterion) {
115115

116116
group.finish();
117117

118-
allocs.print_to_stdout();
118+
allocs.to_report().print_to_stdout();
119119
}

crates/bytesbuf/benches/view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const MANY_SPANS: usize = 32;
3232

3333
#[expect(clippy::too_many_lines, reason = "Is fine - lots of benchmarks to do!")]
3434
fn entrypoint(c: &mut Criterion) {
35-
let allocs = Session::new();
35+
let allocs = Session::new().no_stdout().no_file();
3636

3737
let memory = FixedBlockMemory::new(TEST_SPAN_SIZE);
3838

@@ -265,5 +265,5 @@ fn entrypoint(c: &mut Criterion) {
265265

266266
group.finish();
267267

268-
allocs.print_to_stdout();
268+
allocs.to_report().print_to_stdout();
269269
}

crates/cachet/benches/dynamic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn rt() -> Runtime {
2727
fn bench_dynamic_cache(c: &mut Criterion) {
2828
let rt = rt();
2929
let mut group = c.benchmark_group("dynamic_cache");
30-
let session = Session::new();
30+
let session = Session::new().no_stdout().no_file();
3131

3232
// Baseline: MockCache wrapped normally (no dynamic dispatch)
3333
let static_get_name = "static_get";

crates/fetch/benches/http_crate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn get_uri() -> &'static str {
2020
}
2121

2222
fn entry(c: &mut Criterion) {
23-
let session = Session::new();
23+
let session = Session::new().no_stdout().no_file();
2424
let mut group = c.benchmark_group("http_crate");
2525

2626
let uri_allocs = session.operation("uri");
@@ -67,7 +67,7 @@ fn entry(c: &mut Criterion) {
6767
});
6868

6969
group.finish();
70-
session.print_to_stdout();
70+
session.to_report().print_to_stdout();
7171
}
7272

7373
criterion_group!(benches, entry);

crates/fetch/benches/pipelines.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn get_uri() -> &'static str {
3434
}
3535

3636
fn entry(c: &mut Criterion) {
37-
let session = Session::new();
37+
let session = Session::new().no_stdout().no_file();
3838
let mut group = c.benchmark_group("http_client_pipelines");
3939

4040
let client = HttpClient::builder_fake(StatusCode::OK, &Clock::new_frozen()).build();
@@ -95,7 +95,7 @@ fn entry(c: &mut Criterion) {
9595
});
9696

9797
group.finish();
98-
session.print_to_stdout();
98+
session.to_report().print_to_stdout();
9999
}
100100

101101
criterion_group!(benches, entry);

crates/http_extensions/benches/http_request_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn get_uri() -> Uri {
2828

2929
#[expect(clippy::too_many_lines, reason = "bench code, such is life")]
3030
fn entry(c: &mut Criterion) {
31-
let session = Session::new();
31+
let session = Session::new().no_stdout().no_file();
3232
let mut group = c.benchmark_group("http_request_builder");
3333
let body_builder = HttpBodyBuilder::new_fake();
3434

@@ -197,7 +197,7 @@ fn entry(c: &mut Criterion) {
197197
});
198198

199199
group.finish();
200-
session.print_to_stdout();
200+
session.to_report().print_to_stdout();
201201
}
202202

203203
criterion_group!(benches, entry);

crates/http_extensions/benches/http_response_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize};
1818
static ALLOCATOR: Allocator<std::alloc::System> = Allocator::system();
1919

2020
fn bodies_benchmarks(c: &mut Criterion) {
21-
let session = Session::new();
21+
let session = Session::new().no_stdout().no_file();
2222
let mut group = c.benchmark_group("http_response_builder_bodies");
2323
let body_builder = HttpBodyBuilder::new_fake();
2424

@@ -65,7 +65,7 @@ fn bodies_benchmarks(c: &mut Criterion) {
6565
});
6666

6767
group.finish();
68-
session.print_to_stdout();
68+
session.to_report().print_to_stdout();
6969
}
7070

7171
criterion_group!(benches, bodies_benchmarks);

crates/layered/benches/dynamic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static ALLOCATOR: Allocator<std::alloc::System> = Allocator::system();
1313

1414
fn entry(c: &mut Criterion) {
1515
let mut group = c.benchmark_group("typed-vs-dynamic");
16-
let session = Session::new();
16+
let session = Session::new().no_stdout().no_file();
1717

1818
let service = Execute::new(|v| async move { v });
1919
let operation = session.operation("typed");
@@ -53,7 +53,7 @@ fn entry(c: &mut Criterion) {
5353
});
5454
});
5555

56-
session.print_to_stdout();
56+
session.to_report().print_to_stdout();
5757
}
5858

5959
criterion_group!(benches, entry);

0 commit comments

Comments
 (0)