| Class | AWS::CloudWatch::Metric |
| In: |
lib/aws/cloud_watch/metric.rb
|
| Parent: | Core::Resource |
# Metric
Represents a single metric.
| metric_name | -> | name |
| dimensions | [R] | @return [Array<Hash>] |
| metric_name | [R] | @return [String] |
| namespace | [R] | @return [String] |
@param [String] namespace The metric namespace. @param [String] metric_name The metric name. @param [Hash] options @option options [Array<Hash>] :dimensions An array of dimensions.
Each hash must have a `:name` and a `value` key (with string values).
Publishes metric data points to Amazon CloudWatch. @param [Array<Hash>] metric_data An array of hashes. Each hash
must pass `:value` (number) or `:statistic_values` (hash).
@return [nil]
Gets statistics for this metric.
metric = CloudWatch::Metric.new('my/namepace', 'metric-name')
stats = metric.statistics(
:start_time => Time.now - 3600,
:end_time => Time.now,
:statistics => ['Average'])
stats.label #=> 'some-label'
stats.each do |datapoint|
# datapoint is a hash
end
@param [Hash] options @option options [Time,required] :start_time @option options [Time,required] :end_time @option options [Array<String>,required] :statistics @option options [String] :unit @option options [Integer] :period (60) @return [MetricStatistics]