diff --git a/puffin_http/README.md b/puffin_http/README.md index 7fc57eca..1720418d 100644 --- a/puffin_http/README.md +++ b/puffin_http/README.md @@ -8,3 +8,16 @@ A HTTP server/client for communicating [`puffin`](https://github.com/EmbarkStudios/puffin) profiling events. You can view them using [`puffin_viewer`](https://github.com/EmbarkStudios/puffin/tree/main/puffin_viewer). + +## How to use +Add a `puffin_http` `Server` to the profiled application +When the server is started, [`puffin_viewer`](https://crates.io/crates/puffin_viewer) application can connect to it and display profiling informations. + +``` rust +fn main() { + let server_addr = format!("0.0.0.0:{}", puffin_http::DEFAULT_PORT); + puffin_http::Server::new(&server_addr).unwrap(); +} +``` + +You can checkout the examples/server.rs for a more complete example. \ No newline at end of file diff --git a/puffin_http/src/lib.rs b/puffin_http/src/lib.rs index 47c93cef..eaeb65a2 100644 --- a/puffin_http/src/lib.rs +++ b/puffin_http/src/lib.rs @@ -1,4 +1,13 @@ //! `puffin_server` is a library for streaming `puffin` profiler data over TCP. +//! +//! # How to use +//! Add a `puffin_http` `Server` to the profiled application. +//! When the server is started, [`puffin_viewer`](https://crates.io/crates/puffin_viewer) application can connect to it and display profiling informations. +//! +//! ``` +//! let server_addr = format!("0.0.0.0:{}", puffin_http::DEFAULT_PORT); +//! puffin_http::Server::new(&server_addr).unwrap(); +//! ``` // BEGIN - Embark standard lints v5 for Rust 1.55+ // do not change or add/remove here, but one can add exceptions after this section