9
10
11
12
13
14
15
16
17
|
# File 'lib/fog/aws/models/cloud_watch/metric_statistics.rb', line 9
def all(conditions)
metricName = conditions['MetricName']
namespace = conditions['Namespace']
dimensions = conditions['Dimensions']
get_metric_opts = {"StartTime" => (Time.now-3600).iso8601, "EndTime" => Time.now.iso8601, "Period" => 300}.merge(conditions)
data = service.get_metric_statistics(get_metric_opts).body['GetMetricStatisticsResult']['Datapoints']
data.map! { |datum| datum.merge('MetricName' => metricName, 'Namespace' => namespace, 'Dimensions' => dimensions) }
load(data) end
|