[][src]Crate superluminal_perf

Superluminal Performance profiler Rust API for adding user events to captures.

How to use

In Cargo.toml add:

[dependencies]
superluminal-perf = "0.1.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

enabled

Check if the API is enabled

end_event

End an instrumentation event.

set_current_thread_name

Set the name of the current thread