Nano WebGPU API - v0.11.0
    Preparing search index...

    Class PerformanceTracker

    PerformanceTracker aggregates frame timing and draw metrics. Records FPS, frame processing duration (in milliseconds), total draw calls, mesh counts, polygon indices, and maintains a rolling history to feed profiling graphs.

    Index

    Constructors

    Methods

    • Signals the start of a new frame computation. Resets active counter accumulators and stores the starting timestamp.

      Returns void

    • Signals the end of the frame computations. Calculates elapsed processing time, computes rolling averages, and pushes results to metrics history queues.

      Returns void

    • Registers draw pass details, incrementing vertices and estimated triangle counts.

      Parameters

      • vertexCount: number

        Number of vertices drawn.

      • indexCount: number

        Number of indices processed.

      Returns void

    • Formats large count values using compact SI symbols (K for thousands, M for millions).

      Parameters

      • n: number

        Raw count number.

      Returns string

      Formatted string.

    Properties

    drawCalls: number = 0

    Number of draw commands submitted this frame.

    fps: number = 0

    Estimated frames per second.

    fpsHistory: number[] = []

    Rolling collection of recorded FPS values.

    frameTimeHistory: number[] = []

    Rolling collection of recorded frame timing millisecond values.

    frameTimeMs: number = 0

    Processing duration in milliseconds for the current frame.

    lightCount: number = 0

    Count of active light sources in the scene.

    materialChanges: number = 0

    Count of material pipeline switches this frame.

    nodeCount: number = 0

    Total nodes in the active scene graph.

    totalMeshes: number = 0

    Total registered meshes in the active scene graph.

    trianglesDrawn: number = 0

    Number of polygon faces processed this frame.

    verticesDrawn: number = 0

    Number of coordinates sent to vertex pipelines this frame.

    visibleMeshes: number = 0

    Number of active visible meshes drawn this frame.