v0.5.0

The profiler accumulates wall-clock timings for engine phases, board work, scripting jobs, and native queues across the process. It is disabled by default and is registered only in the primary orchestrator scripting context. Timings include time blocked inside an instrumented scope, so queue and lock contention can appear alongside active CPU work.

Import #

import * as Profiler from 'Helix/Profiler';

Functions #

setEnabled
Enables or disables collection and returns the resulting state.
setEnabled(enabled: boolean): boolean
isEnabled
Returns whether profiling collection is enabled.
isEnabled(): boolean
reset
Clears counters, gauges, high-water marks, and the elapsed interval.
reset(): void
snapshot
Returns a synchronous snapshot of all accumulated profiler data.
  • Each counter contains thread, name, calls, totalMs, maxMs, and lastMs.
  • Each gauge contains name, current, and highWater.
  • Counters are sorted by thread and descending total time, making the result suitable for a simple monitoring UI.
snapshot(): { enabled, elapsedMs, counters, gauges }
import * as Profiler from 'Helix/Profiler';

Profiler.reset();
Profiler.setEnabled(true);

const snapshot = Profiler.snapshot();
for (const counter of snapshot.counters) {
  console.log(counter.thread, counter.name, counter.totalMs, counter.maxMs);
}