ControlSampleTimes method of the CIM_MetricService class

Allows specification of the point in time metric gathering is to be started and to specify the preferred sample interval time for periodic data gathering.

Whenever sampling for additional metrics is started, the settings specified by this method may be used.

Syntax

uint32 ControlSampleTimes(
  [in] datetime StartSampleTime,
  [in] datetime PreferredSampleInterval,
  [in] boolean  RestartGathering
);

Parameters

StartSampleTime [in]

Point in time when sampling for the metrics is to be started.

A value of 99990101000000.000000+000 shall indicate that sampling should start at the next time it is synchronized to the full hour. Sampling is synchronized to the full hour if seconds since midnight modulo sample interval in seconds is equal to 0.

PreferredSampleInterval [in]

Preferred sample interval time. In order to get correlatable metrics, it is recommended that the sample interval be chosen in a way that 3600 modulo sample interval time in seconds is equal to 0.

It is the responsibility of the CIM metric service implementation to decide whether the requested sample interval time is honored.

The CIM client can check whether or not the metric providers are honoring the requested sample interval time by retrieving related BaseMetricDefinition instances and checking the contents of the CIM_BaseMetricDefinition.SampleInterval property.

RestartGathering [in]

TRUE to request that gathering of all metrics associated to the metric service is re-started with this method call.

Return value

Returns a 0 on success; otherwise, returns an error.

Success (0)

Not Supported (1)

Failed (2)

Method Reserved (..)

Vendor Specific (32768..65535)

Requirements

Requirement Value
Minimum supported client
Windows 8.1
Minimum supported server
Windows Server 2012 R2
Namespace
Root\virtualization\v2
MOF
WindowsVirtualization.V2.mof
DLL
Vmms.exe

See also

CIM_MetricService