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_event
Begin an instrumentation event with the specified ID
begin_event_with_color
Begin an instrumentation event with the specified ID and color
begin_event_with_data
Begin an instrumentation event with the specified ID, runtime data, and color
begin_fiber_switch
Begin a Windows Fiber Switch
enabled
Check if the API is enabled
end_event
End an instrumentation event.
end_fiber_switch
End a Windows Fiber Switch
register_fiber
Register a Windows Fiber
set_current_thread_name
Set the name of the current thread
unregister_fiber
Unregister a Windows Fiber