|
|
@@ -5,8 +5,9 @@
|
|
|
<para>
|
|
|
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 cout the <ulink ulr="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/index.html?SvcIntro.html">
|
|
|
+ <acronym>EC2</acronym>) and Elastic Load Balancing. For more details information
|
|
|
+ check cout the <ulink
|
|
|
+ url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/index.html?SvcIntro.html">
|
|
|
Amazon CloudWatch Developers Guide</ulink>
|
|
|
</para>
|
|
|
|
|
|
@@ -16,7 +17,7 @@
|
|
|
<example id="zend.service.amazon.ec2.cloudwatch.usage.list">
|
|
|
<title>Listing Aviable Metrics</title>
|
|
|
<para>
|
|
|
- <code>listMetrics</code> returns a list of up to 500 valid metrics for
|
|
|
+ <methodname>listMetrics()</methodname> 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.
|
|
|
</para>
|
|
|
@@ -30,77 +31,99 @@ $return = $ec2_ebs->listMetrics();
|
|
|
<example id="zend.service.amazon.ec2.cloudwatch.usage.getmetricstatistics">
|
|
|
<title>Return Statistics for a given metric</title>
|
|
|
<para>
|
|
|
- <code>getMetricStatistics</code> Returns data for one or more
|
|
|
+ <methodname>getMetricStatistics()</methodname> Returns data for one or more
|
|
|
statistics of given a metric.
|
|
|
</para>
|
|
|
- <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.
|
|
|
- </note>
|
|
|
<para>
|
|
|
- <code>getMetricStatistics</code> only requires two parameters but it also has four
|
|
|
- additional parameters that are optional.
|
|
|
- <itemizedlist>
|
|
|
- <listitem>
|
|
|
- <emphasis>Required:</emphasis>
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
+ <note>
|
|
|
+ <para>
|
|
|
+ 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.
|
|
|
+ </para>
|
|
|
+ </note>
|
|
|
+ </para>
|
|
|
+ <para>
|
|
|
+ <methodname>getMetricStatistics()</methodname> only requires two parameters but it
|
|
|
+ also has four additional parameters that are optional.
|
|
|
+ </para>
|
|
|
+ <itemizedlist>
|
|
|
+ <listitem>
|
|
|
+ <para><emphasis>Required:</emphasis></para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
<emphasis>MeasureName</emphasis> The measure name that corresponds to
|
|
|
- the measure for the gathered metric. Valid EC2 Values are
|
|
|
+ the measure for the gathered metric. Valid <acronym>EC2</acronym> Values are
|
|
|
CPUUtilization, NetworkIn, NetworkOut, DiskWriteOps
|
|
|
DiskReadBytes, DiskReadOps, DiskWriteBytes. Valid Elastic
|
|
|
Load Balancing Metrics are Latency, RequestCount, HealthyHostCount
|
|
|
- UnHealthyHostCount. <ulink url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-AmazonCloudWatch-metricscollected.html">
|
|
|
+ UnHealthyHostCount. <ulink
|
|
|
+ url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-AmazonCloudWatch-metricscollected.html">
|
|
|
For more information click here</ulink>
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>Statistics</emphasis> The statistics to be returned for the given metric. Valid
|
|
|
- values are Average, Maximum, Minimum, Samples, Sum. You can specify
|
|
|
- this as a string or as an array of values. If you don't specify one
|
|
|
- it will default to Average instead of failing out. If you specify an incorrect
|
|
|
- option it will just skip it. <ulink url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-Amazon-CloudWatch-statistics.html">
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
+ <emphasis>Statistics</emphasis> The statistics to be returned for the given
|
|
|
+ metric. Valid values are Average, Maximum, Minimum, Samples, Sum. You can
|
|
|
+ specify this as a string or as an array of values. If you don't specify one
|
|
|
+ it will default to Average instead of failing out. If you specify an
|
|
|
+ incorrect option it will just skip it. <ulink
|
|
|
+ url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-Amazon-CloudWatch-statistics.html">
|
|
|
For more information click here</ulink>
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>Optional:</emphasis>
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>Dimensions</emphasis> Amazon CloudWatch allows you to specify one Dimension to further filter
|
|
|
- metric data on. If you don't specify a dimension, the service returns the aggregate
|
|
|
- of all the measures with the given measure name and time range.
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>Unit</emphasis> The standard unit of Measurement for a given Measure. Valid Values: Seconds,
|
|
|
- Percent, Bytes, Bits, Count, Bytes/Second, Bits/Second, Count/Second, and None
|
|
|
- Constraints: When using count/second as the unit, you should use Sum as the statistic
|
|
|
- instead of Average. Otherwise, the sample returns as equal to the number of requests
|
|
|
- instead of the number of 60-second intervals. This will cause the Average to
|
|
|
- always equals one when the unit is count/second.
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>StartTime</emphasis> The timestamp of the first datapoint to return, inclusive. For example,
|
|
|
- 2008-02-26T19:00:00+00:00. We round your value down to the nearest minute.
|
|
|
- You can set your start time for more than two weeks in the past. However,
|
|
|
- you will only get data for the past two weeks. (in ISO 8601 format)
|
|
|
- Constraints: Must be before EndTime
|
|
|
- </listitem>
|
|
|
- <listitem>
|
|
|
- <emphasis>EndTime</emphasis> The timestamp to use for determining the last datapoint to return. This is
|
|
|
- the last datapoint to fetch, exclusive. For example, 2008-02-26T20:00:00+00:00.
|
|
|
- (in ISO 8601 format)
|
|
|
- </listitem>
|
|
|
- </itemizedlist>
|
|
|
- </para>
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para><emphasis>Optional:</emphasis></para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
+ <emphasis>Dimensions</emphasis> Amazon CloudWatch allows you to specify one
|
|
|
+ Dimension to further filter metric data on. If you don't specify a
|
|
|
+ dimension, the service returns the aggregate of all the measures with the
|
|
|
+ given measure name and time range.
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
+ <emphasis>Unit</emphasis> The standard unit of Measurement for a given
|
|
|
+ Measure. Valid Values: Seconds, Percent, Bytes, Bits, Count, Bytes/Second,
|
|
|
+ Bits/Second, Count/Second, and None. Constraints: When using count/second
|
|
|
+ as the unit, you should use Sum as the statistic instead of Average.
|
|
|
+ Otherwise, the sample returns as equal to the number of requests
|
|
|
+ instead of the number of 60-second intervals. This will cause the Average
|
|
|
+ to always equals one when the unit is count/second.
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
+ <emphasis>StartTime</emphasis> The timestamp of the first datapoint to
|
|
|
+ return, inclusive. For example, 2008-02-26T19:00:00+00:00. We round your
|
|
|
+ value down to the nearest minute. You can set your start time for more than
|
|
|
+ two weeks in the past. However, you will only get data for the past two
|
|
|
+ weeks. (in ISO 8601 format). Constraints: Must be before EndTime.
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ <listitem>
|
|
|
+ <para>
|
|
|
+ <emphasis>EndTime</emphasis> The timestamp to use for determining the last
|
|
|
+ datapoint to return. This is the last datapoint to fetch, exclusive. For
|
|
|
+ example, 2008-02-26T20:00:00+00:00 (in ISO 8601 format).
|
|
|
+ </para>
|
|
|
+ </listitem>
|
|
|
+ </itemizedlist>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
|
$ec2_ebs = new Zend_Service_Amazon_Ec2_CloudWatch('aws_key','aws_secret_key');
|
|
|
-$return = $ec2_ebs->getMetricStatistics(array('MeasureName' => 'NetworkIn', 'Statistics' => array('Average')));
|
|
|
+$return = $ec2_ebs->getMetricStatistics(
|
|
|
+ array('MeasureName' => 'NetworkIn',
|
|
|
+ 'Statistics' => array('Average')));
|
|
|
]]></programlisting>
|
|
|
</example>
|
|
|
</sect2>
|
|
|
-</sect1>
|
|
|
+</sect1>
|