File tree Expand file tree Collapse file tree
telemetry-subscribers/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: Apache-2.0
33
44use std:: alloc:: System ;
5+
56use telemetry_subscribers:: flamegraph:: CounterAlloc ;
67#[ global_allocator]
78static GLOBAL : CounterAlloc < System > = CounterAlloc :: new ( System ) ;
@@ -25,10 +26,8 @@ async fn main() {
2526
2627 // follow instructions in telemetry-subscribers README how to setup grafana to
2728 // visualize the flamegraphs
28- // println!(
29- // "{}",
30- // serde_json::to_string_pretty(&sub.get_nested_sets("iota-benchmark::flamegraph")).unwrap()
31- // );
29+ // let nested_sets = sub.get_nested_sets("iota-benchmark::flamegraph");
30+ // println!("{}", serde_json::to_string_pretty(&nested_sets).unwrap());
3231 // println!();
3332 println ! (
3433 "{}" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ mod svg;
1212mod tracing;
1313#[ cfg( feature = "flamegraph-alloc" ) ]
1414pub use alloc:: { AllocMetrics , CounterAlloc , get_alloc_metrics} ;
15+
1516pub use grafana:: NestedSetFrame ;
1617pub use svg:: { Config as SvgConfig , Svg } ;
1718pub use tracing:: FlameSub ;
Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: Apache-2.0
33
44use std:: time:: Duration ;
5+
56#[ cfg( feature = "flamegraph-alloc" ) ]
67use super :: alloc:: AllocMetrics ;
78
@@ -224,8 +225,8 @@ where
224225 samples : 1 ,
225226 start : Default :: default ( ) ,
226227 total : raw. total ,
227- #[ cfg( feature = "flamegraph-alloc" ) ]
228- alloc : AllocMetrics :: new ( ) ,
228+ #[ cfg( feature = "flamegraph-alloc" ) ]
229+ alloc : AllocMetrics :: new ( ) ,
229230 } ) ;
230231 Some ( raw. render ( caption, config) )
231232 }
You can’t perform that action at this time.
0 commit comments