Crate superluminal_perf
source ·Expand description
Superluminal Performance profiler Rust API for adding user events to captures.
How to use
In Cargo.toml
add:
[dependencies]
superluminal-perf = "0.2.0"
Example usage:
superluminal_perf::begin_event("my-event");
calc();
superluminal_perf::end_event();
superluminal_perf::begin_event("my-event2");
calc2();
superluminal_perf::end_event();
On non-Windows platforms the events will be compiled out.
Feature flags
enable
- this flag is used by default and enables calling the Superluminal Performance API. This can be useful to only enable the events only for specific application features
Functions
- Begin an instrumentation event with the specified ID
- Begin an instrumentation event with the specified ID and color
- Begin an instrumentation event with the specified ID, runtime data, and color
- Begin a Windows Fiber Switch
- Check if the API is enabled
- End an instrumentation event.
- End a Windows Fiber Switch
- Register a Windows Fiber
- Set the name of the current thread
- Unregister a Windows Fiber