Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Class PerfCounters<Name>

    The counter store. Name narrows the names it accepts; the process-wide perfCounters takes only declared ones, while a bare new PerfCounters() (tests of the store itself) takes any string.

    Type Parameters

    • Name extends string = string
    Index
    names: string[] = []
    index: Map<string, number> = ...
    values: Float64Array<ArrayBuffer> = ...
    gauges: Uint8Array<ArrayBuffer> = ...

    1 for a slot gauge() has written (kept across reset()), else 0.

    rings: Map<string, unknown[]> = ...
    resetHooks: Set<() => void> = ...
    • Raise a high-water mark to v if it is larger.

      Parameters

      • slot: number
      • v: number

      Returns void

    • Append a structured record to the bounded ring for kind.

      Parameters

      • kind: string
      • rec: unknown

      Returns void

    • Run hook on every reset. For per-window state a counter's owner keeps beside it (e.g. the duplicate-decode history behind decode.duplicates), which must start the new window empty too. Returns an unsubscribe.

      Parameters

      • hook: () => void

      Returns () => void

    • Start a new window: zero every counter and high-water mark, drop every record, and run the onReset hooks. Gauges keep their current value. Slots stay valid.

      Returns void