profserve 0.1.0

HTTP-Enabled Profiling for Rust
Documentation
  • Coverage
  • 33.33%
    5 out of 15 items documented0 out of 8 items with examples
  • Size
  • Source code size: 67.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 13s Average build duration of successful builds.
  • all releases: 1m 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dat58/ProfServe
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dat58

ProfServe - HTTP-Enabled Profiling for Rust

Documentation Crates.io License Download

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.

Features

  • 🚀 HTTP API for remote profiling
  • 🔥 Flamegraph generation in SVG format
  • 🔒 Async-ready for modern Rust applications

Quick Start

Installation

Add to your Cargo.toml:

[dependencies]
profserve = "0.1"

Basic Usage

fn main() {
    std::thread::spawn(|| profserve::http::serve(8080).expect("Failed to start profserve"));
    // your code goes here
}

Making Requests

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

API Endpoints

Endpoint Method Parameters Description
/prof/cpu GET seconds, output, frequency Capture profile