traceperf
    Preparing search index...

    Class OptimizedExecutionTracker

    Optimized tracker for individual function executions

    Index
    blockingThreshold: number

    Sync time (ms) from which detailed output flags event-loop blocking; 0 disables

    defaultSampleRate: number
    defaultThreshold: number
    enabled: boolean

    When false, tracked functions just call through (no timing at all)

    enableNestedTracking: boolean
    reporter: ((root: ExecutionRecord) => void) | null

    Replaces console output for reported trees (null = default console tree)

    showMemoryUsage: boolean
    silent: boolean
    stats: StatsCollector | null

    Per-label statistics (null when disabled)

    trackingMode: string
    • Create a trackable version of a function

      Type Parameters

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

      Parameters

      • fn: T

        Function to track

      • options: Record<string, any> = {}

        Tracking options

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

      Tracked version of the function

    • End timing a function execution

      Parameters

      • executionId: string

        ID of the execution to end

      • Optionalresult: any

        Result of the function

      • error: Error | null = null

        Error if the function threw

      Returns ExecutionData | null

      Execution data

    • Mark the end of the synchronous part of an execution that returned a promise

      Parameters

      • executionId: string

      Returns void

    • Start a manually-ended execution (a "span"). Use run() to execute code as part of it, so tracked calls inside attach as children, and end() when the work is finished.

      Parameters

      • label: string
      • options: Record<string, any> = {}

      Returns Span

    • Start timing a function execution

      Parameters

      • label: string

        Function name or label

      • parentExecutionId: string | null = null

        ID of parent execution if nested

      • options: TimerOptions = {}

        Additional options

      • args: ArrayLike<unknown> | undefined = options.args

      Returns string

      Execution ID

    • Track a function execution directly

      Type Parameters

      • T

      Parameters

      • fn: () => T

        Function to track

      • options: Record<string, any> = {}

        Tracking options

      Returns T

      Function result

    • Track a module's methods

      Type Parameters

      • T extends Record<string, any>

      Parameters

      • module: T

        Module to track

      • options: Record<string, any> = {}

        Tracking options

      Returns T

      Tracked module