GetMetricStatistics如何打破数据点的时间间隔?

时间:2016-04-25 10:17:49

标签: php amazon-web-services amazon-ec2 amazon-cloudwatch

使用以下代码,我打算在最后一小时获得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'),
        ));

根据documentation

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.

所以,我应该在一分钟内获得所有时间戳。不是吗?

0 个答案:

没有答案