Caution: The documentation you are viewing is
for an older version of Zend Framework.
You can find the documentation of the current version at:
https://docs.zendframework.com/
ZendService\Amazon\Ec2: CloudWatch Monitoring — Zend Framework 2 2.4.9 documentation
Amazon CloudWatch is an easy-to-use web service that provides comprehensive monitoring for Amazon Elastic Compute Cloud (Amazon EC2) and Elastic Load Balancing. For more details information check out the Amazon CloudWatch Developers Guide
listMetrics() returns a list of up to 500 valid metrics for which there is recorded data available to a you and a NextToken string that can be used to query for the next set of results.
1 2 | $ec2_ebs = new ZendService\Amazon\Ec2\CloudWatch('aws_key','aws_secret_key');
$return = $ec2_ebs->listMetrics();
|
getMetricStatistics() Returns data for one or more statistics of given a metric.
Note
The maximum number of datapoints that the Amazon CloudWatch service will return in a single GetMetricStatistics request is 1,440. If a request is made that would generate more datapoints than this amount, Amazon CloudWatch will return an error. You can alter your request by narrowing the time range (StartTime, EndTime) or increasing the Period in your single request. You may also get all of the data at the granularity you originally asked for by making multiple requests with adjacent time ranges.
getMetricStatistics() only requires two parameters but it also has four additional parameters that are optional.
1 2 3 4 | $ec2_ebs = new ZendService\Amazon\Ec2\CloudWatch('aws_key','aws_secret_key');
$return = $ec2_ebs->getMetricStatistics(
array('MeasureName' => 'NetworkIn',
'Statistics' => array('Average')));
|