Crates.io | profserve |
lib.rs | profserve |
version | 0.1.0 |
created_at | 2025-05-02 14:11:01.865299+00 |
updated_at | 2025-05-02 14:11:01.865299+00 |
description | HTTP-Enabled Profiling for Rust |
homepage | |
repository | https://github.com/dat58/profserve |
max_upload_size | |
id | 1657741 |
size | 21,001 |
ProfServe is a Rust crate that provides HTTP endpoints for performance profiling, built on top of pprof-rs
. It enables remote profiling capabilities for your Rust applications with flamegraph generation and pprof data export.
Add to your Cargo.toml
:
[dependencies]
profserve = "0.1"
fn main() {
std::thread::spawn(|| profserve::http::serve(8080).expect("Failed to start profserve"));
// your code goes here
}
Get a 10-second profile as flamegraph:
curl -s "http://localhost:8080/prof/cpu?seconds=10&frequency=100&output=flamegraph" > profile.svg
Get raw text pprof data:
curl -s "http://localhost:8080/prof/cpu?seconds=10&output=text" > profile.txt
Endpoint | Method | Parameters | Description |
---|---|---|---|
/prof/cpu |
GET | seconds , output , frequency |
Capture profile |