使用以下代码,我打算在最后一小时获得CPUUtilization
。我得到的是一组以5 minutes
的时间间隔分隔的数据点。这是为什么?
$dimensions = array(
array('Name' => 'InstanceId', 'Value' => 'i-4dxxxd95'),
);
$stats = $cloudWatchClient->getMetricStatistics(array(
'Namespace' => 'AWS/EC2',
'MetricName' => 'CPUUtilization',
'Dimensions' => $dimensions,
'StartTime' => strtotime('-1 hour'),
'EndTime' => strtotime('now'),
'Period' => 60,
'Statistics' => array('Maximum', 'Minimum'),
));
Amazon CloudWatch aggregates data points based on the length of the period that you specify.
For example, if you request statistics with a one-minute granularity, Amazon
CloudWatch aggregates data points with time stamps that fall within the
same one-minute period. In such a case, the data points queried
can greatly outnumber the data points returned.
所以,我应该在一分钟内获得所有时间戳。不是吗?