Performance Metrics

Note

Check out the Performance Metrics Sample Project for a working demo of performance metrics functionality.

Some OpenXR runtimes implement extensions allowing users to query device and application performance metrics. Currently, this is supported on Meta and Android XR devices.

Project Settings

To enable vendor performance metrics, the feature must be enabled in your project settings. The extension setting can be found in Project Settings under the OpenXR section, the Vendor Performance Metrics setting should be listed under Extensions. Advanced Settings must be enabled for the setting to be visible.

../_images/performance_metrics_project_setting.png

In the same Extensions section, under Vendor Performance Metrics, there is a Capture on Startup setting. This is enabled by default, and will make the runtime automatically capture performance metrics on startup when the extension is enabled. Capturing may be enabled or disabled by updating the capture_performance_metrics property.

Debug Monitors

When enabled, vendor performance metrics are visible in Godot's debug monitor display. This requires Deploy with Remote Debug to be enabled under the Debug menu.

../_images/performance_metrics_remote_debug.png

Upon deploying to your XR device, the extra performance metrics will be available in the Debug panel under the Monitors tab.

../_images/performance_metrics_monitors.png

Manually Querying Metrics

Performance metrics may also be queried manually. This is done by retrieving the available counter paths from the runtime, and then using the corresponding counter path to get a dictionary of metric info.

var counter_paths = OpenXRVendorPerformanceMetrics.get_performance_metrics_counter_paths()
for counter_path in counter_paths:
  var metric: Dictionary = OpenXRVendorPerformanceMetrics.query_performance_metrics_counter(counter_path)

The returned dictionary has the following keys:

Note

Look at the Performance Metrics Sample Project for more example code that manually queries performance metrics.