When you retrieve a subset of current or historic metrics, you can specify the metrics by name, or by using a pattern that includes a wildcard character.

Metric Names

Metric names are dot-separated strings.

Table 1. Metric Names
Metric Name Type Unit Description
cpu.usage.average rate percent Host view of this virtual machine's average actively used CPU as a percentage of total available. Includes all cores in all sockets.
cpu.usagemhz.average rate megahertz Host view of this virtual machine's average actively used CPU as a raw measurement . Includes all cores in all sockets.
cpu.usage.maximum rate percent Host view of this virtual machine's maximum actively used CPU as a percentage of total available. Includes all cores in all sockets.
mem.usage.average absolute percent Memory used by this virtual machine as a percentage of total configured memory.
disk.provisioned.latest absolute kilobytes Storage space allocated to this virtual hard disk in the containing organization virtual data center.
disk.used.latest absolute kilobytes Storage used by all virtual hard disks.
disk.read.average rate kilobytes per second Average read rate for all virtual hard disks.
disk.write.average rate kilobytes per second Average write rate for all virtual hard disks.
Note: When a virtual machine has multiple disks, metrics are reported as an aggregate for all disks. CPU metrics are an aggregate of all cores and sockets.

Metric Patterns

A CurrentUsageSpec or HistoricUsageSpec can include MetricPattern elements that specify multiple metric names using a wildcard character. To form a metric pattern, replace any component of a metric name with an asterisk, which is a wildcard that matches all values of the metric name component it replaces. For example, this MetricPattern matches all metric names that begin with disk.
<MetricPattern>disk.*</MetricPattern>
The response would include these metric names: disk.provisioned.latest, disk.used.latest, disk.read.average, and disk.write.average.
A different MetricPattern matches all metric names that begin with disk and end with average.
<MetricPattern>disk.*.average</MetricPattern>
The response would include the metric names disk.read.average and disk.write.average.

Metric Series Expected Intervals and Timestamps

A HistoricUsage element includes zero or more MetricSeries elements, each of which includes a set of Sample elements. Each MetricSeries has an expectedInterval attribute that specifies the interval, in milliseconds, at which the samples in the series are reported. Each Sample in the MetricSeries has a timestamp attribute noting the absolute time at which the sample was taken. You can use the timestamp and expectedInterval values to aggregate sample data, and to determine when metrics became unavailable because the virtual machine was powered off or unreachable.

Specifying Collection Start and End Times

A HistoricUsageSpec can include a time specification that constrains the result set to metrics collected between a start time and an end time. This time specification can be relative or absolute.

In RelativeStartTime and RelativeEndTime elements, start and end times are specified as an interval and a unit, which are interpreted as interval units ago. For example, this HistoricUsageSpec requests metrics collected during the past 8 hours.
<HistoricUsageSpec xmlns="http://www.vmware.com/vcloud/v1.5">
   <RelativeStartTime
      interval="8"
      unit="hour"/>
   <RelativeEndTime
      interval="0"
      unit="hour"/>
   ...
</HistoricUsageSpec>
You can also write this specification with no RelativeEndTime element, rather than a RelativeEndTime with an interval attribute value of 0. Both constructions specify an end time of now.
Alternatively, you can use AbsoluteStartTime and AbsoluteEndTime elements to specify absolute start and end times in a HistoricUsageSpec, as shown in this example, which returns metrics recorded during a one hour period:
<HistoricUsageSpec xmlns="http://www.vmware.com/vcloud/v1.5">
   <AbsoluteStartTime time="2013-11-13T10:00:00.000Z" />
   <AbsoluteEndTime time="2013-11-13T11:00:00.000Z" />
   ...
</HistoricUsageSpec>