File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ serde = "1.0"
4040anyhow = " 1.0.31"
4141unicode-width = " 0.1"
4242
43- [target .'cfg(unix)' .dependencies ]
44- pprof = { version = " 0.3" , features = [" flamegraph" ], optional = true }
45- [target .'cfg(macos)' .dependencies ]
43+ [target .'cfg(not(windows))' .dependencies ]
4644pprof = { version = " 0.3" , features = [" flamegraph" ], optional = true }
4745
4846[badges ]
Original file line number Diff line number Diff line change 22/// also we make sure to generate a flamegraph on program exit
33pub struct Profiler {
44 #[ cfg( feature = "pprof" ) ]
5+ #[ cfg( not( windows) ) ]
56 guard : pprof:: ProfilerGuard < ' static > ,
67}
78
89impl Profiler {
910 pub fn new ( ) -> Self {
1011 Self {
1112 #[ cfg( feature = "pprof" ) ]
13+ #[ cfg( not( windows) ) ]
1214 guard : pprof:: ProfilerGuard :: new ( 100 )
1315 . expect ( "profiler launch error" ) ,
1416 }
1517 }
1618
1719 fn report ( & mut self ) {
1820 #[ cfg( feature = "pprof" ) ]
21+ #[ cfg( not( windows) ) ]
1922 if let Ok ( report) = self . guard . report ( ) . build ( ) {
2023 let file = std:: fs:: File :: create ( "flamegraph.svg" )
2124 . expect ( "flamegraph file err" ) ;
You can’t perform that action at this time.
0 commit comments