Skip to content

Commit

Permalink
Add how to use puffin http (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen-lg authored Oct 26, 2022
1 parent 1efc17b commit 1e951a8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions puffin_http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions puffin_http/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1e951a8

Please sign in to comment.