Pyroscope Profiler

Pyroscope Profiler for Rust. Profile your Rust applications.

license tests build Crate


You may be looking for:

Table of Contents

Quick Start

Add this to your Cargo.toml:

toml [dependencies] pyroscope = "0.5.0" pyroscope-pprofrs = "0.2"

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 agent = PyroscopeAgent::builder("http://localhost:4040", "myapp-profile") .backend(pprof_backend) .build()?;

Profile your code:

```rust let agent_running = agent.start()?;

// Computation to profile

let agentready = agentrunning.stop()?; agent_ready.shutdown(); ```

Pyroscope Server

The Pyroscope Agent send the profiling data to a Pyroscope Server. You need to have a Pyroscope Server running in order to consume and visualize this data. It's not possible, currently, to forward the data to another endpoint.

Multi-Threading

The Pyroscope Agent and the pprof-rs backend can profile and report data from a multi-threaded program. pprof-rs, however, does not track child-processes and thus profiling is limited to a single process.

Profiling Backends

The Pyroscope Agent doesn't do any profiling. The agent role is to orchasrate a profiling backend, and report the profiling data to the Pyroscope Server. The Agent can support external backends (in fact, all current backends are independent crates) and you can make your own. Backends can also be used seperately. The currently available backends are:

Limitations

Getting help

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.

License

Pyroscope is distributed under the Apache License (Version 2.0).

See LICENSE for details.