大网数据广告活动
Hyper-V与虚拟化

ControlSampleTimes method of the CIM_MetricService class

· 52CE 我爱测

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.

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

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。