Class AWS::CloudWatch::Metric
In: lib/aws/cloud_watch/metric.rb
Parent: Core::Resource

# Metric

Represents a single metric.

Methods

External Aliases

metric_name -> name

Attributes

dimensions  [R]  @return [Array<Hash>]
metric_name  [R]  @return [String]
namespace  [R]  @return [String]

Public Class methods

@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).

Public Instance methods

@return [Boolean] Returns `true` if this metric exists.

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]

Protected Instance methods

[Validate]