ControlMetrics method of the Msvm_MetricService class
Used to control the collection of metrics for a managed element or elements.
Syntax
uint32 ControlMetrics(
[in] CIM_ManagedElement REF Subject,
[in] CIM_BaseMetricDefinition REF Definition,
[in] uint16 MetricCollectionEnabled
);
Parameters
-
Subject [in]
-
A CIM_ManagedElement instance that identifies the managed elements for which metrics will be collected. If this parameter is Null, the metrics for all the managed elements associated with the Definition parameter will be collected.
-
Definition [in]
-
An Msvm_BaseMetricDefinition instance that specifies which metrics will be collected. If this parameter is Null, the metrics for all the definitions associated with the managed element identified by the Subject parameter will be collected
-
MetricCollectionEnabled [in]
-
Specifies the operation to perform on the metrics collection. This must be one of the following values.
-
Enable (2)
-
Enable metrics collection.
-
Disable (3)
-
Disable metrics collection.
-
Reset (4)
-
Reset metrics values.
-
DMTF Reserved (..)
-
Vendor Reserved (32768..65535)
Return value
This method returns one of the following values.
-
Success (0)
-
Not Supported (1)
-
Failed (2)
-
Method Reserved (..)
-
Vendor Specific (32768..65535)
Remarks
This method will fail in the following instances:
- The Subject and Definition parameters are both Null.
- The Subject and Definition parameters are both non-Null and there is not an instance of Msvm_MetricDefForME that associates the two instances.
- The Definition parameter is a reference to an instance of Msvm_BaseMetricDefinition that is not associated with the Msvm_MetricService through Msvm_ServiceAffectsElement.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 8 [desktop apps only] |
Minimum supported server |
Windows Server 2012 [desktop apps only] |
Namespace |
Root\Virtualization\V2 |
MOF |
|
DLL |
|