Pyroscope Profiler for Rust. Profile your Rust applications.
You may be looking for:
Add this to your Cargo.toml
:
toml
[dependencies]
pyroscope = "0.4.0"
pyroscope-pprofrs = "0.1"
Configure and create the backend (pprof-rs)
rust
let pprof_config = PprofConfig::new().sample_rate(100);
let pprof_backend = Pprof::new(pprof_config);
Configure the Pyroscope agent:
rust
let mut agent =
PyroscopeAgent::builder("http://localhost:4040", "myapp-profile")
.backend(pprof_backend)
.build()?;
Profile your code:
```rust agent.start(); // Profiled computation agent.stop();
// Non-profiled computation ```
You can read the Docs or check the examples for detailed usage of the library. You can also join the Slack channel if you have questions.
Pyroscope is distributed under the Apache License (Version 2.0).
See LICENSE for details.