generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alllow using custom GlobalProfiler instance with puffin_http::Server (#…
…212) # Checklist * [X] I have read the [Contributor Guide](../CONTRIBUTING.md) * [X] I have read and agree to the [Code of Conduct](../CODE_OF_CONDUCT.md) * [X] I have added a description of my changes and why I'd like them included in the section below # Changes Allow `puffin_http::Server` to use a custom `puffin::GlobalProfiler` instance. - Add a new constructor function `Server::new_custom()` - It takes in two function pointers to call when adding/removing the `Server` as a `Sink`. - These can be changed to add to a `GlobalProfiler` instance that isn't the default instance returned by `GlobalProfiler::lock()` - Existing `Server::new()` now simply wraps this new function around the default `GlobalProfiler::lock()` function, so behaviour is the same - Add extensive documentation including working examples and a helpful macro # Example Usage Here's a video of me using it to profile my project [`rayna`](https://github.com/v0x0g/rayna). On the left we have my app, with the **render** profiler running top right and the **ui** profiler running bottom right. Note that this is _one app process_, but it has two separate `puffin_http::Server` instances. Note how in the video these profilers are sending frames completely independently, but for the same process. _Apologies for the compression, it doesn't seem to like my noisy images..._ https://github.com/EmbarkStudios/puffin/assets/153816778/f1ef7625-294b-4347-aad4-0062f0f1b3b7
- Loading branch information
Showing
3 changed files
with
208 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters