Skip to content

Commit 47a0bda

Browse files
authored
[fix] metrics collection (#26)
* test * cleanup
1 parent 25265e7 commit 47a0bda

File tree

1 file changed

+4
-2
lines changed
  • crates/stark-sdk/src/bench

1 file changed

+4
-2
lines changed

crates/stark-sdk/src/bench/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ pub fn run_with_metric_collection<R>(
2727
.with(ForestLayer::default())
2828
.with(MetricsLayer::new());
2929
// Prepare tracing.
30-
let _ = tracing::subscriber::set_default(subscriber);
30+
tracing::subscriber::set_global_default(subscriber).unwrap();
3131

3232
// Prepare metrics.
3333
let recorder = DebuggingRecorder::new();
3434
let snapshotter = recorder.snapshotter();
3535
let recorder = TracingContextLayer::all().layer(recorder);
36-
let res = metrics::with_local_recorder(&recorder, f);
36+
// Install the registry as the global recorder
37+
metrics::set_global_recorder(recorder).unwrap();
38+
let res = f();
3739

3840
if let Ok(file) = file {
3941
serde_json::to_writer_pretty(&file, &serialize_metric_snapshot(snapshotter.snapshot()))

0 commit comments

Comments
 (0)