Zend_Service_Amazon_Ec2-CloudWatch.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- EN-Revision: 16389 -->
  3. <!-- Reviewed: no -->
  4. <sect1 id="zend.service.amazon.ec2.cloudwatch">
  5. <title>Zend_Service_Amazon_Ec2: CloudWatch Monitoring</title>
  6. <para>
  7. Amazon CloudWatch is an easy-to-use web service that provides
  8. comprehensive monitoring for Amazon Elastic Compute Cloud (Amazon
  9. <acronym>EC2</acronym>) and Elastic Load Balancing. For more details information
  10. check cout the <ulink
  11. url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/index.html?SvcIntro.html">
  12. Amazon CloudWatch Developers Guide</ulink>
  13. </para>
  14. <sect2 id="zend.service.amazon.ec2.cloudwatch.usage">
  15. <title>CloudWatch Usage</title>
  16. <example id="zend.service.amazon.ec2.cloudwatch.usage.list">
  17. <title>Listing Aviable Metrics</title>
  18. <para>
  19. <methodname>listMetrics()</methodname> returns a list of up to 500 valid metrics for
  20. which there is recorded data available to a you and a NextToken string
  21. that can be used to query for the next set of results.
  22. </para>
  23. <programlisting language="php"><![CDATA[
  24. $ec2_ebs = new Zend_Service_Amazon_Ec2_CloudWatch('aws_key','aws_secret_key');
  25. $return = $ec2_ebs->listMetrics();
  26. ]]></programlisting>
  27. </example>
  28. <example id="zend.service.amazon.ec2.cloudwatch.usage.getmetricstatistics">
  29. <title>Return Statistics for a given metric</title>
  30. <para>
  31. <methodname>getMetricStatistics()</methodname> Returns data for one or more
  32. statistics of given a metric.
  33. </para>
  34. <para>
  35. <note>
  36. <para>
  37. The maximum number of datapoints that the Amazon CloudWatch service will
  38. return in a single GetMetricStatistics request is 1,440. If a request is
  39. made that would generate more datapoints than this amount, Amazon CloudWatch
  40. will return an error. You can alter your request by narrowing the time range
  41. (StartTime, EndTime) or increasing the Period in your single request. You
  42. may also get all of the data at the granularity you originally asked for
  43. by making multiple requests with adjacent time ranges.
  44. </para>
  45. </note>
  46. </para>
  47. <para>
  48. <methodname>getMetricStatistics()</methodname> only requires two parameters but it
  49. also has four additional parameters that are optional.
  50. </para>
  51. <itemizedlist>
  52. <listitem>
  53. <para><emphasis>Required:</emphasis></para>
  54. </listitem>
  55. <listitem>
  56. <para>
  57. <emphasis>MeasureName</emphasis> The measure name that corresponds to
  58. the measure for the gathered metric. Valid <acronym>EC2</acronym> Values are
  59. CPUUtilization, NetworkIn, NetworkOut, DiskWriteOps
  60. DiskReadBytes, DiskReadOps, DiskWriteBytes. Valid Elastic
  61. Load Balancing Metrics are Latency, RequestCount, HealthyHostCount
  62. UnHealthyHostCount. <ulink
  63. url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-AmazonCloudWatch-metricscollected.html">
  64. For more information click here</ulink>
  65. </para>
  66. </listitem>
  67. <listitem>
  68. <para>
  69. <emphasis>Statistics</emphasis> The statistics to be returned for the given
  70. metric. Valid values are Average, Maximum, Minimum, Samples, Sum. You can
  71. specify this as a string or as an array of values. If you don't specify one
  72. it will default to Average instead of failing out. If you specify an
  73. incorrect option it will just skip it. <ulink
  74. url="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/arch-Amazon-CloudWatch-statistics.html">
  75. For more information click here</ulink>
  76. </para>
  77. </listitem>
  78. <listitem>
  79. <para><emphasis>Optional:</emphasis></para>
  80. </listitem>
  81. <listitem>
  82. <para>
  83. <emphasis>Dimensions</emphasis> Amazon CloudWatch allows you to specify one
  84. Dimension to further filter metric data on. If you don't specify a
  85. dimension, the service returns the aggregate of all the measures with the
  86. given measure name and time range.
  87. </para>
  88. </listitem>
  89. <listitem>
  90. <para>
  91. <emphasis>Unit</emphasis> The standard unit of Measurement for a given
  92. Measure. Valid Values: Seconds, Percent, Bytes, Bits, Count, Bytes/Second,
  93. Bits/Second, Count/Second, and None. Constraints: When using count/second
  94. as the unit, you should use Sum as the statistic instead of Average.
  95. Otherwise, the sample returns as equal to the number of requests
  96. instead of the number of 60-second intervals. This will cause the Average
  97. to always equals one when the unit is count/second.
  98. </para>
  99. </listitem>
  100. <listitem>
  101. <para>
  102. <emphasis>StartTime</emphasis> The timestamp of the first datapoint to
  103. return, inclusive. For example, 2008-02-26T19:00:00+00:00. We round your
  104. value down to the nearest minute. You can set your start time for more than
  105. two weeks in the past. However, you will only get data for the past two
  106. weeks. (in ISO 8601 format). Constraints: Must be before EndTime.
  107. </para>
  108. </listitem>
  109. <listitem>
  110. <para>
  111. <emphasis>EndTime</emphasis> The timestamp to use for determining the last
  112. datapoint to return. This is the last datapoint to fetch, exclusive. For
  113. example, 2008-02-26T20:00:00+00:00 (in ISO 8601 format).
  114. </para>
  115. </listitem>
  116. </itemizedlist>
  117. <programlisting language="php"><![CDATA[
  118. $ec2_ebs = new Zend_Service_Amazon_Ec2_CloudWatch('aws_key','aws_secret_key');
  119. $return = $ec2_ebs->getMetricStatistics(
  120. array('MeasureName' => 'NetworkIn',
  121. 'Statistics' => array('Average')));
  122. ]]></programlisting>
  123. </example>
  124. </sect2>
  125. </sect1>