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.

Constructors

Accessors

Methods

Constructors

  • Create a new MiniStats instance.

    Parameters

    • app: AppBase

      The application.

    • Optionaloptions: {
          cpu: {
              enabled: boolean;
              watermark: number;
          };
          gpu: {
              enabled: boolean;
              watermark: number;
          };
          sizes: {
              graphs: boolean;
              height: number;
              spacing: number;
              width: number;
          }[];
          startSizeIndex: number;
          stats: {
              decimalPlaces: number;
              name: string;
              stats: string[];
              unitsName: string;
              watermark: number;
          }[];
          textRefreshRate: number;
      }

      Options for the MiniStats instance.

      • cpu: {
            enabled: boolean;
            watermark: number;
        }

        CPU graph options.

        • enabled: boolean
        • watermark: number
      • gpu: {
            enabled: boolean;
            watermark: number;
        }

        GPU graph options.

        • enabled: boolean
        • watermark: number
      • sizes: {
            graphs: boolean;
            height: number;
            spacing: number;
            width: number;
        }[]

        Sizes of area to render individual graphs in and spacing between individual graphs.

      • startSizeIndex: number

        Index into sizes array for initial setting.

      • stats: {
            decimalPlaces: number;
            name: string;
            stats: string[];
            unitsName: string;
            watermark: number;
        }[]

        Array of options to render additional graphs based on stats collected into AppBase#stats.

      • textRefreshRate: number

        Refresh rate of text stats in ms.

    Returns MiniStats

    // create a new MiniStats instance using default options
    const miniStats = new pc.MiniStats(app);

Accessors

Methods

  • Returns the default options for MiniStats. The default options configure the overlay to show the following graphs:

    • CPU utilization
    • GPU utilization
    • Overall frame time
    • Draw call count

    Returns object

    The default options for MiniStats.

    const options = pc.MiniStats.getDefaultOptions();