Engine API Reference - v2.23.0-beta.1
    Preparing search index...

    Class MiniStats

    MiniStats is a small graphical overlay that displays realtime performance metrics. By default, it shows CPU and GPU utilization, frame timings and draw call count. It can also be configured to display additional graphs based on data collected into AppBase#stats.

    The detailed per-frame sub-timings — script, anim, physics and gsplat sort — are measured in every build. The render timing is the exception: its start timestamp is only recorded in the debug and profiler builds, so in the release build the render graph reports the time elapsed since page load rather than a frame time. Import from 'playcanvas/debug' or 'playcanvas/profiler' for a meaningful render figure.

    Index
    • Create a new MiniStats instance.

      Parameters

      Returns MiniStats

      const miniStats = new MiniStats(app);
      
    • get enabled(): boolean

      Returns boolean

    • set enabled(value: boolean): void

      Whether the overlay and its counter sampling are enabled. Defaults to true.

      Parameters

      • value: boolean

      Returns void

    • Destroy the MiniStats instance and release its event listeners, textures and mesh.

      Returns void

      miniStats.destroy();
      
    • Returns options for three sizes: compact core counters, grouped averages, and grouped averages and peaks with graph history. Draw calls and frame time appear first, followed by ungrouped counters in their configured order, then CPU, GPU and VRAM.

      Parameters

      • OptionalextraStats: string[] = []

        Presets to include: 'gsplats' or 'gsplatsCopy'.

      Returns MiniStatsOptions

      The default options for MiniStats.

      const options = MiniStats.getDefaultOptions(['gsplats']);
      options.sizes[2].width = 280;
      const miniStats = new MiniStats(app, options);