Skip to content

Commit 98a6db2

Browse files
committed
fix(profiler): fix permissions issues with profiler doc test
1 parent 91e842b commit 98a6db2

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/profiler/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ flamegraph = ["pprof/flamegraph"]
1010
protobuf-codec = ["pprof/protobuf-codec"]
1111

1212
[dependencies]
13+
tempfile.workspace = true
1314
tracing.workspace = true
1415
thiserror.workspace = true
1516

crates/profiler/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,11 @@ fn setup(path: String, frequency: i32, interval: u64, name: String) -> Result<()
194194
///
195195
/// ```
196196
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
197+
/// let temp_dir = tempfile::Builder::new().prefix("my-service-profile-").tempdir()?;
198+
/// let profile_path = temp_dir.path().to_str().ok_or("Invalid path")?.to_string();
199+
///
197200
/// profiler::setup_profiling(
198-
/// "/opt/profiling/my-service".to_string(),
201+
/// profile_path,
199202
/// 150,
200203
/// 120,
201204
/// Some("My Service".to_string()),

0 commit comments

Comments
 (0)