Skip to content

Commit d369550

Browse files
authored
chore: use pprof only if target_os is not windows (#40)
## Motivation Fix #39 follow up #36 CI fail ## Solution add `#[cfg(not(target_os = "windows"))]` condition to pprof dependencies
1 parent 76771cf commit d369550

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ async-trait = "0.1.56"
4141
criterion = { version = "0.4.0", default-features = false, features = ["html_reports"] }
4242
opentelemetry-jaeger = "0.19.0"
4343
opentelemetry-stdout = { version = "0.1.0", features = ["trace"] }
44-
pprof = { version = "0.11.1", features = ["flamegraph", "criterion"] }
4544
futures-util = { version = "0.3", default-features = false }
4645
tokio = { version = "1", features = ["full"] }
4746
tokio-stream = "0.1"
4847
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }
4948

49+
[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
50+
pprof = { version = "0.11.1", features = ["flamegraph", "criterion"] }
51+
5052
[lib]
5153
bench = false
5254

benches/trace.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use opentelemetry::{
44
trace::{SpanBuilder, Tracer as _, TracerProvider as _},
55
Context,
66
};
7+
#[cfg(not(target_os = "windows"))]
78
use pprof::criterion::{Output, PProfProfiler};
89
use std::time::SystemTime;
910
use tracing::trace_span;
@@ -123,9 +124,16 @@ fn tracing_harness() {
123124
dummy();
124125
}
125126

127+
#[cfg(not(target_os = "windows"))]
126128
criterion_group! {
127129
name = benches;
128130
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
129131
targets = many_children
130132
}
133+
#[cfg(target_os = "windows")]
134+
criterion_group! {
135+
name = benches;
136+
config = Criterion::default();
137+
targets = many_children
138+
}
131139
criterion_main!(benches);

0 commit comments

Comments
 (0)