traceperf
    Preparing search index...

    Class BrowserLogger

    Browser-compatible TracePerf instance.

    Shares the core tracker with the Node.js entry (same nesting, statistics, hooks, exporters and options) and adds console-style logging methods. Output uses the browser format:

    Execution Flow: → parent (12.34ms) → child (10.01ms)

    Hierarchy (View Summary)

    Index
    • Create a trackable version of a function. Calls go through track(), so nested trackables attach to their caller.

      Type Parameters

      • T extends (...args: any[]) => any

      Parameters

      Returns (...args: Parameters<T>) => ReturnType<T>

    • Parameters

      • message: string | object
      • ...args: any[]

      Returns void

    • Parameters

      • message: string | object
      • ...args: any[]

      Returns void

    • Parameters

      • label: string

      Returns void

    • Parameters

      • message: string | object
      • ...args: any[]

      Returns void

    • Call listener for every finished call (nested ones included) that took at least threshold ms. Pass a number, or per-label thresholds with an optional '*' default:

      tp.onSlow(200, (call, root) => logger.warn(${call.label} took ${call.duration}ms in ${root.label})); tp.onSlow({ 'db.query': 50, 'GET /search': 500, '*': 1000 }, alert);

      Works in every tracking mode and when silent. Returns an unsubscribe function.

      Parameters

      Returns () => void

    • Parameters

      • message: string | object
      • ...args: any[]

      Returns void