NvRulesAPI: NV::Rules::IMetric Class Reference

# NV::Rules::IMetric Class Reference
[NvRules Python garbage-collected classes.]

Metric interface. More...

## Public Types
enum | MetricSubtype
| Metric subtype. More...
enum | MetricType
| Metric type. More...
enum | RollupOperation
| Rollup Operation. More...
enum | ValueKind
| Metric value kind. More...
## Public Member Functions
virtual double | as_double (size_t instance)=0
| Get a value from the metric instances as double.
virtual double | as_double ()=0
| Get the metric value as double.
virtual const char * | as_string (size_t instance)=0
| Get a value from the metric instances as string.
virtual const char * | as_string ()=0
| Get the metric value as string.
virtual uint64_t | as_uint64 (size_t instance)=0
| Get a value from the metric instances as 64bit integer.
virtual uint64_t | as_uint64 ()=0
| Get the metric value as 64bit integer.
virtual PYRETURN IMetric * | correlation_ids ()=0
| Get a metric object for this metric's instance value's correlation IDs.
virtual Description | description () const =0
| Get the metric description.
virtual bool | has_correlation_ids ()=0
| Check if the metric has correlation IDs.
virtual bool | has_value (ValueKind value_kind)=0
| Check if the metric has a non-instanced value of a specific kind.
virtual bool | has_value ()=0
| Check if the metric has a non-instanced value.
virtual ValueKind | kind (size_t instance)=0
| Get the metric value kind for an instance value.
virtual ValueKind | kind ()=0
| Get the metric value kind.
virtual MetricSubtype | metric_subtype () const =0
| Get the metric subtype.
virtual MetricType | metric_type () const =0
| Get the metric type.
virtual const char * | name ()=0
| Get the metric name.
virtual size_t | num_instances ()=0
| Get the number of instance values for this metric.
virtual RollupOperation | rollup_operation () const =0
| Get the type of rollup operation.
virtual Unit | unit () const =0
| Get the metric unit.

## Detailed Description

Represents a single, named metric. A metric can carry one value or multiple, if it is an instanced metric.

## Member Enumeration Documentation

enum NV::Rules::IMetric::MetricSubtype

Indicates the subtype of the metric. Subtypes only apply to hardware metrics. Other metric types have subtype `None` in Python.

enum NV::Rules::IMetric::MetricType

Indicates the type of the metric. May take values `COUNTER`, `RATIO` or `THROUGHPUT` for hardware metrics, and `OTHER` for all other types (e.g. launch metrics, device attributes).

enum NV::Rules::IMetric::RollupOperation

Indicates the type of operation that is used to accumulate multiple values of a given metric. May take values `AVG`, `MAX`, `MIN` and `SUM`, as well as `None`, if no such operation is specified.

enum NV::Rules::IMetric::ValueKind

Indicates the kind (or type) of a metric value, metric instance value or correlation ID.

## Member Function Documentation

virtual double NV::Rules::IMetric::as_double | ( | size_t | instance | ) | `[pure virtual]`

Get the value of metric instance `instance` as double

virtual double NV::Rules::IMetric::as_double | ( |  | ) | `[pure virtual]`

Get the metric value as double

virtual const char* NV::Rules::IMetric::as_string | ( | size_t | instance | ) | `[pure virtual]`

Get the value of metric instance `instance` as string

virtual const char* NV::Rules::IMetric::as_string | ( |  | ) | `[pure virtual]`

Get the metric value as string

virtual uint64_t NV::Rules::IMetric::as_uint64 | ( | size_t | instance | ) | `[pure virtual]`

Get the value of metric instance `instance` as 64bit integer

virtual uint64_t NV::Rules::IMetric::as_uint64 | ( |  | ) | `[pure virtual]`

Get the metric value as 64bit integer

virtual PYRETURN IMetric* NV::Rules::IMetric::correlation_ids | ( |  | ) | `[pure virtual]`

Returns a new metric object representing the correlation IDs for the metric's instance values. Use has_correlation_ids to check if this metric has correlation IDs for its instance values. Correlation IDs are used to associate instance values with the "instance" their value represents. In the returned new metric object, the correlation IDs are that object's instance values.

virtual Description NV::Rules::IMetric::description | ( |  | ) | const`[pure virtual]`

Get a textual description of the metric

virtual bool NV::Rules::IMetric::has_correlation_ids | ( |  | ) | `[pure virtual]`

If true, the metric has correlation IDs matching its instance values, which can be accessed using correlation_ids .

virtual bool NV::Rules::IMetric::has_value | ( | ValueKind | value_kind | ) | `[pure virtual]`

Check if the metric has a value of a specific `value_kind` . If true, the metric may still have instance values, too.

virtual bool NV::Rules::IMetric::has_value | ( |  | ) | `[pure virtual]`

Check if the metric has a non-instanced value. If true, the metric may still have instance values, too.

virtual ValueKind NV::Rules::IMetric::kind | ( | size_t | instance | ) | `[pure virtual]`

Get the metric value kind for its instance value `instance` . num_instances can be used to check the total number of instance values.

virtual ValueKind NV::Rules::IMetric::kind | ( |  | ) | `[pure virtual]`

Get the metric value kind

virtual MetricSubtype NV::Rules::IMetric::metric_subtype | ( |  | ) | const`[pure virtual]`

Get the metric subtype

virtual MetricType NV::Rules::IMetric::metric_type | ( |  | ) | const`[pure virtual]`

Get the metric type

virtual const char* NV::Rules::IMetric::name | ( |  | ) | `[pure virtual]`

Get the metric name

virtual size_t NV::Rules::IMetric::num_instances | ( |  | ) | `[pure virtual]`

Get the number of instance values for this metric. Not all metrics have instance values. If a metric has instance values, it may also have correlation_ids matching these instance values.

virtual RollupOperation NV::Rules::IMetric::rollup_operation | ( |  | ) | const`[pure virtual]`

Get the type of rollup operation

virtual Unit NV::Rules::IMetric::unit | ( |  | ) | const`[pure virtual]`

Get the metric unit