This extension provides APIs to enumerate and query performance metrics counters of the current XR device and XR application. Developers can perform performance analysis and do targeted optimization to the XR application using the performance metrics counters being collected. The application should not change its behavior based on the counter reads.
The performance metrics counters are organized into predefined XrPath values, under the root path pathname:/perfmetrics_meta. An application can query the available counters through EnumeratePerformanceMetricsCounterPathsMETA. Here is a list of the performance metrics counter paths that may be provided on Meta devices:
After a session is created, an application can use SetPerformanceMetricsStateMETA to enable the performance metrics system for that session. An application can use QueryPerformanceMetricsCounterMETA to query a performance metrics counter on a session that has the performance metrics system enabled, or use GetPerformanceMetricsStateMETA to query if the performance metrics system is enabled.
Note
the measurement intervals of individual performance metrics counters are defined by the OpenXR runtime. The application must not make assumptions or change its behavior at runtime by measuring them.
In order to enable the functionality of this extension, the application must pass the name of the extension into CreateInstance via the XrInstanceCreateInfo::enabledExtensionNames parameter as indicated in the extensions section.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | XR_META_PERFORMANCE_METRICS_EXTENSION_NAME
The extension name. |
| public static final int | XR_META_performance_metrics_SPEC_VERSION
The extension specification version. |
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_META
XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
|
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META
XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
|
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META
XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
|
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_META
XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description |
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_META
XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description |
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_META
XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description |
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_META
XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description |
| public static final int | XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_META
XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description |
| public static final int | XR_TYPE_PERFORMANCE_METRICS_COUNTER_META
Extends |
| public static final int | XR_TYPE_PERFORMANCE_METRICS_STATE_META
Extends |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static int | nxrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, int
the capacity of the counterPathCapacityInput, long counterPathCountOutput, long counterPaths)counterPaths array, or 0 to indicate a request to retrieve the required capacity.Unsafe version of: |
| public static int | nxrGetPerformanceMetricsStateMETA(XrSession session, long state)
Unsafe version of: |
| public static int | nxrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, long counter)
Unsafe version of: |
| public static int | nxrSetPerformanceMetricsStateMETA(XrSession session, long state)
Unsafe version of: |
| public static int | xrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance
an instance, IntBuffer XrInstance handle previously created with CreateInstance.filled in by the runtime with the count of counterPathCountOutput, LongBuffer counterPaths written or the required capacity in the case that counterPathCapacityInput is insufficient.an array of counterPaths)XrPath filled in by the runtime which contains all the available performance metrics counters, but can be NULL if counterPathCapacityInput is 0.Enumerate all performance metrics counter paths that supported by the runtime. |
| public static int | xrGetPerformanceMetricsStateMETA(XrSession
an session, XrPerformanceMetricsStateMETA XrSession handle previously created with CreateSession.a pointer to an state)XrPerformanceMetricsStateMETA structure.Get current state of performance metrics. |
| public static int | xrQueryPerformanceMetricsCounterMETA(XrSession
an session, long XrSession handle previously created with CreateSession.a valid performance metrics counter path. counterPath, XrPerformanceMetricsCounterMETA a pointer to an counter)XrPerformanceMetricsCounterMETA structure.Query performance metrics counter. |
| public static int | xrSetPerformanceMetricsStateMETA(XrSession
an session, XrPerformanceMetricsStateMETA XrSession handle previously created with CreateSession.a pointer to an state)XrPerformanceMetricsStateMETA structure.Enable/disable performance metrics. |
| XR_META_PERFORMANCE_METRICS_EXTENSION_NAME | back to summary |
|---|---|
| public static final String XR_META_PERFORMANCE_METRICS_EXTENSION_NAME The extension name. | |
| XR_META_performance_metrics_SPEC_VERSION | back to summary |
|---|---|
| public static final int XR_META_performance_metrics_SPEC_VERSION The extension specification version. | |
| XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_META | back to summary |
|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_META XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
| |
| XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META | back to summary |
|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
| |
| XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META | back to summary |
|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions
| |
| XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_META | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_META XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description
See Also | |||||||||||||
| XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_META | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_META XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description
See Also | |||||||||||||
| XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_META | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_META XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description
See Also | |||||||||||||
| XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_META | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_META XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description
See Also | |||||||||||||
| XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_META | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_META XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description
See Also | |||||||||||||
| XR_TYPE_PERFORMANCE_METRICS_COUNTER_META | back to summary |
|---|---|
| public static final int XR_TYPE_PERFORMANCE_METRICS_COUNTER_META Extends Enum values: | |
| XR_TYPE_PERFORMANCE_METRICS_STATE_META | back to summary |
|---|---|
| public static final int XR_TYPE_PERFORMANCE_METRICS_STATE_META Extends Enum values: | |
| METAPerformanceMetrics | back to summary |
|---|---|
| protected METAPerformanceMetrics() | |
| nxrEnumeratePerformanceMetricsCounterPathsMETA | back to summary |
|---|---|
| public static int nxrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, int counterPathCapacityInput, long counterPathCountOutput, long counterPaths) Unsafe version of:
| |
| nxrGetPerformanceMetricsStateMETA | back to summary |
|---|---|
| public static int nxrGetPerformanceMetricsStateMETA(XrSession session, long state) Unsafe version of: | |
| nxrQueryPerformanceMetricsCounterMETA | back to summary |
|---|---|
| public static int nxrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, long counter) Unsafe version of: | |
| nxrSetPerformanceMetricsStateMETA | back to summary |
|---|---|
| public static int nxrSetPerformanceMetricsStateMETA(XrSession session, long state) Unsafe version of: | |
| xrEnumeratePerformanceMetricsCounterPathsMETA | back to summary |
|---|---|
| public static int xrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, IntBuffer counterPathCountOutput, LongBuffer counterPaths) Enumerate all performance metrics counter paths that supported by the runtime. C SpecificationThe
Valid Usage (Implicit)
Return Codes
| |
| xrGetPerformanceMetricsStateMETA | back to summary |
|---|---|
| public static int xrGetPerformanceMetricsStateMETA(XrSession session, XrPerformanceMetricsStateMETA state) Get current state of performance metrics. C SpecificationThe
DescriptionThe Valid Usage (Implicit)
Return Codes
See Also
| |
| xrQueryPerformanceMetricsCounterMETA | back to summary |
|---|---|
| public static int xrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, XrPerformanceMetricsCounterMETA counter) Query performance metrics counter. C SpecificationThe
DescriptionThe The application should enable the performance metrics system (by calling If Valid Usage (Implicit)
Return Codes
See Also
| |
| xrSetPerformanceMetricsStateMETA | back to summary |
|---|---|
| public static int xrSetPerformanceMetricsStateMETA(XrSession session, XrPerformanceMetricsStateMETA state) Enable/disable performance metrics. C SpecificationThe
DescriptionThe Valid Usage (Implicit)
Return Codes
See Also
| |