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.

      • Optionalcpu?: { enabled?: boolean; watermark?: number }

        CPU graph options.

        • Optionalenabled?: boolean

          Whether to show the CPU graph.

        • Optionalwatermark?: number

          Watermark - shown as a line on the graph, useful for displaying a budget.

      • Optionalgpu?: { enabled?: boolean; watermark?: number }

        GPU graph options.

        • Optionalenabled?: boolean

          Whether to show the GPU graph.

        • Optionalwatermark?: number

          Watermark - shown as a line on the graph, useful for displaying a budget.

      • Optionalsizes?: { graphs?: boolean; height?: number; spacing?: number; width?: number }[]

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

      • OptionalstartSizeIndex?: number

        Index into sizes array for initial setting.

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

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

      • OptionaltextRefreshRate?: 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();