Class IMetricsSourceComposite

Inheritance Relationships

Base Type

Class Documentation

class IMetricsSourceComposite : public virtual gpa::metrics::IMetricsSource

Interface used to manage one or more MetricsSource objects and present them as a single composite object that supports the IMetricsSource interface.

Note

Terminology Key:

  • Metric

    • Local Metric index

      • Index of a Metric object in the individual MetricGroup it is associated with.

    • Global Metric index

      • Index of a Metric object in the individual MetricsSource (not a composite) it is associated with.

    • Composite Metric index

      • Index of a Metric object in the composite MetricsSource it is associated with.

  • MetricGroup

    • Local MetricGroup index

      • Index of a MetricGroup object in the individual MetricsSource (not a composite) it is associated with.

    • Composite/global MetricGroup index

      • Index of a MetricGroup object in the composite MetricsSource it is associated with.

  • MetricsSource

    • MetricsSource index

      • Index of a MetricsSource object in the composite MetricsSource it is associated with. This could also be considered a local MetricsSource index but that distinction is unneeded as there are no global ones.

  • Metric Prototype

    • Local Metric Prototype index

      • Index of a Metric Prototype in the individual MetricSource (not a composite) it is associated with.

    • Composite/global Metric Prototype index

      • Index of a Metric Prototype in the composite MetricsSource it is associated with.

  • Instantiated Metric Prototype index

    • Local Instantiated Metric Prototype index

      • Index of an Instantiated Metric Prototype in the individual MetricSource (not a composite) it is associated with.

    • Composite/global Instantiated Metric Prototype index

      • Index of an Instantiated Metric Prototype in the composite MetricsSource it is associated with.

Note

The type of a composite MetricsSource object is kComposite.

Note

All of the MetricsSource objects in the composite are configured with the same graphics API, and thus the composite MetricsSource object's graphics API matches them.

Note

All of the MetricsSource objects in the composite are associated with the same GPU, and thus the composite MetricsSource object's GpuId matches that GPU.

Note

Be mindful that the number of available metric groups and metrics in the composite (as well as their associated indices), will change after instantiating a MetricsSource's available Metric Prototypes and preparing them for usage.

Note

This interface is NOT thread-safe.

Warning

The composite object's MetricsSource objects (whose IMetricsSource interfaces are obtained via the MetricsSource function, and IMetricGroup interfaces are obtained via the MetricGroup function), have no knowledge they are part of a composite object. Thus, for each MetricsSource object, the global counts and global indices returned by it, its MetricGroup, and its individual Metric objects are relative to itself. Several functions were added to this interface to assist with this limitation and help ease usage.

Public Functions

virtual ~IMetricsSourceComposite()
virtual uint32_t NumMetricsSources() const = 0

Gets the number of MetricsSource objects contained by the composite MetricsSource object that can be obtained using the MetricsSource function.

Returns

Number of available MetricsSource objects.

virtual IMetricsSource const *MetricsSource(uint32_t const metricsSourceIndex) const = 0

Gets the IMetricsSource interface for the specified MetricsSource object.

Parameters

metricsSourceIndex -- [in] Index of the MetricsSource object whose interface will be returned. Must be in range: [0, IMetricsSourceComposite::NumMetricsSources).

Returns

Upon success, returns an interface to the specified MetricsSource object. Otherwise, nullptr is returned.

virtual Result MetricsSourceContainingGroup(uint32_t const compositeMetricGroupIndex, uint32_t *pMetricsSourceIndex, uint32_t *pLocalMetricGroupIndex = nullptr) const = 0

Provides the MetricsSource index associated with a MetricGroup specified using its composite/global index in the composite MetricsSource object. Optionally, also provides the MetricGroup object's corresponding local index in the MetricsSource object.

Parameters
  • globalMetricGroupIndex -- [in] Global MetricGroup index in range: [0, IMetricsSourceComposite::NumMetricGroups).

  • pMetricsSourceIndex -- [inout] Pointer to a MetricsSource object index that will be initialized upon success.

  • pLocalMetricGroupIndex -- [inout] Optional pointer to the corresponding local MetricGroup object index that will be initialized upon success.

Returns

Upon success, initializes the provided indices and returns Result::kSuccess. Otherwise, another failure enumerator is returned.

virtual Result MetricsSourceContainingMetric(uint32_t const compositeMetricIndex, uint32_t *pMetricsSourceIndex, uint32_t *pGlobalMetricIndex = nullptr) const = 0

Provides the MetricsSource index associated with a Metric specified using its composite index in the composite MetricsSource object. Optionally, also provides the Metric object's corresponding global index in the MetricsSource object.

Parameters
  • compositeMetricIndex -- [in] Composite Metric index in range: [0, IMetricsSourceComposite::NumAvailableMetrics).

  • pMetricsSourceIndex -- [inout] Pointer to a MetricsSource object index that will be initialized upon success.

  • pGlobalMetricIndex -- [inout] Optional pointer to the corresponding global Metric object index that will be initialized upon success.

Returns

Upon success, initializes the provided indices and returns Result::kSuccess. Otherwise, another failure enumerator is returned.

virtual int32_t MetricsSourceStartGroupIndex(uint32_t const metricsSourceIndex) const = 0

Gets the composite/global MetricGroup index for the first MetricGroup of the specified MetricsSource object.

Note

After creating the composite, when/if a MetricsSource's instantiated Metric Prototypes are prepared for usage, the first composite/global MetricGroup index returned for the specified MetricsSource object might be different afterwards.

Parameters

metricsSourceIndex -- [in] Index of the MetricsSource object, for which the first MetricsGroup's composite/global index will be determined. Must be in range: [0, IMetricsSourceComposite::NumMetricsSources).

Returns

Upon success, returns the composite MetricGroup index for the first MetricGroup of the specified MetricsSource object. Otherwise, an invalid MetricGroup index is returned such as -1.

virtual int32_t MetricsSourceStartMetricIndex(uint32_t const metricsSourceIndex) const = 0

Gets the composite Metric index for the first Metric in the first MetricGroup of the specified MetricsSource object.

Note

After creating the composite, when/if a MetricsSource's instantiated Metric Prototypes are prepared for usage, the first composite Metric index returned for the first MetricGroup of the specified MetricsSource object might be different afterwards.

Parameters

metricsSourceIndex -- [in] Index of the MetricsSource object, for which the first MetricGroup's first Metric's composite index will be determined. Must be in range: [0, IMetricsSourceComposite::NumMetricsSources).

Returns

Upon success, returns the composite Metric index for the first Metric in the first MetricGroup of the specified MetricsSource. Otherwise, an invalid Metric index is returned such as -1.