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

    Class MiniStats

    MiniStats is a small graphical overlay that displays realtime performance metrics. By default, it shows CPU and GPU durations, frame intervals, draw call count and estimated GPU resource memory. It can also display additional counters from AppBase#stats.

    The default CPU timings, including render time, draw call count and memory estimates are available in all builds. GPU timing requires device support and is enabled when MiniStats creates its GPU timer. Some additional counters, such as AppStats#primitiveCount, require a debug or profiler build. See AppStats for measurement scope and availability. In the detailed views, click a category heading to collapse or expand its sub-counters. Click elsewhere in the overlay to change size. Collapsing a category preserves its sampling and graph history. Resources is enabled and collapsed by default, and displays current counts of existing tracked resources, including internal resources, in detailed views. Resource counts refresh at textRefreshRate while visible, including their sum in the collapsed heading; they have no average or peak. In graph views, resource histories use the latest sampled counts and scale to accommodate the highest count seen.

    Index
    • Create a new MiniStats instance.

      Parameters

      Returns MiniStats

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

      Returns boolean

    • set cpuCollapsed(value: boolean): void

      Whether the CPU section is collapsed in detailed views. Defaults to false. Collapsing hides its sub-counters while keeping the total visible, without stopping sampling or discarding history. The state is preserved when changing sizes and updated when the heading is clicked.

      Parameters

      • value: boolean

      Returns void

      miniStats.cpuCollapsed = true;
      
    • 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

    • get engineCollapsed(): boolean

      Returns boolean

    • set engineCollapsed(value: boolean): void

      Whether the Engine section is collapsed in detailed views. Defaults to false. Collapsing hides its counters without stopping sampling or discarding history. The state is preserved when changing sizes and updated when the heading is clicked.

      Parameters

      • value: boolean

      Returns void

      miniStats.engineCollapsed = true;
      
    • get gpuCollapsed(): boolean

      Returns boolean

    • set gpuCollapsed(value: boolean): void

      Whether the GPU section is collapsed in detailed views. Defaults to false. Collapsing hides its sub-counters while keeping the total visible, without stopping sampling or discarding history. The state is preserved when changing sizes and updated when the heading is clicked.

      Parameters

      • value: boolean

      Returns void

      miniStats.gpuCollapsed = true;
      
    • get resourcesCollapsed(): boolean

      Returns boolean

    • set resourcesCollapsed(value: boolean): void

      Whether the Resources section is collapsed in detailed views. Defaults to true. Current counts are sampled at the configured textRefreshRate while the section is visible and MiniStats is enabled. The collapsed heading shows their sum to help spot resource growth. Changing size preserves the collapsed state.

      Parameters

      • value: boolean

      Returns void

      miniStats.resourcesCollapsed = false;
      
    • get resourcesEnabled(): boolean

      Returns boolean

    • set resourcesEnabled(value: boolean): void

      Whether the Resources section is shown in detailed views. Defaults to true. Counts use existing engine resource tracking, including internal resources, and are not a complete inventory of native GPU objects. Uniform buffers include pooled GPU backing buffers, but exclude staging buffers and individual transient allocations. Render targets are counted once initialized; WebGPU pipelines count cached entries.

      Parameters

      • value: boolean

      Returns void

      miniStats.resourcesEnabled = false;
      
    • get userCollapsed(): boolean

      Returns boolean

    • set userCollapsed(value: boolean): void

      Whether the User section is collapsed in detailed views. Defaults to false. Collapsing hides its counters without stopping sampling or discarding history. The state is preserved when changing sizes and updated when the heading is clicked.

      Parameters

      • value: boolean

      Returns void

      miniStats.userCollapsed = true;
      
    • get vramCollapsed(): boolean

      Returns boolean

    • set vramCollapsed(value: boolean): void

      Whether the VRAM section is collapsed in detailed views. Defaults to false. Collapsing hides its sub-counters while keeping the total visible, without stopping sampling or discarding history. The state is preserved when changing sizes and updated when the heading is clicked.

      Parameters

      • value: boolean

      Returns void

      miniStats.vramCollapsed = true;
      
    • 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. Engine counters appear first, starting with draw calls and frame time, followed by User, CPU, GPU and VRAM. In the detailed views, Engine and User have collapsible headings, omitted when empty.

      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);