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"
40
40
anyhow = " 1.0.31"
41
41
unicode-width = " 0.1"
42
42
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 ]
46
44
pprof = { version = " 0.3" , features = [" flamegraph" ], optional = true }
47
45
48
46
[badges ]
Original file line number Diff line number Diff line change 2
2
/// also we make sure to generate a flamegraph on program exit
3
3
pub struct Profiler {
4
4
#[ cfg( feature = "pprof" ) ]
5
+ #[ cfg( not( windows) ) ]
5
6
guard : pprof:: ProfilerGuard < ' static > ,
6
7
}
7
8
8
9
impl Profiler {
9
10
pub fn new ( ) -> Self {
10
11
Self {
11
12
#[ cfg( feature = "pprof" ) ]
13
+ #[ cfg( not( windows) ) ]
12
14
guard : pprof:: ProfilerGuard :: new ( 100 )
13
15
. expect ( "profiler launch error" ) ,
14
16
}
15
17
}
16
18
17
19
fn report ( & mut self ) {
18
20
#[ cfg( feature = "pprof" ) ]
21
+ #[ cfg( not( windows) ) ]
19
22
if let Ok ( report) = self . guard . report ( ) . build ( ) {
20
23
let file = std:: fs:: File :: create ( "flamegraph.svg" )
21
24
. expect ( "flamegraph file err" ) ;
You can’t perform that action at this time.
0 commit comments