mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Added some defaults for StartTime, EndTime and Period to model for MetricStatistics
This commit is contained in:
parent
f9d26321d2
commit
8232576e0d
1 changed files with 2 additions and 1 deletions
|
@ -11,7 +11,8 @@ module Fog
|
|||
metricName = conditions['MetricName']
|
||||
namespace = conditions['Namespace']
|
||||
dimensions = conditions['Dimensions']
|
||||
data = connection.get_metric_statistics(conditions).body['GetMetricStatisticsResult']['Datapoints']
|
||||
get_metric_opts = {"StartTime" => (Time.now-3600).iso8601, "EndTime" => Time.now.iso8601, "Period" => 300}.merge(conditions)
|
||||
data = connection.get_metric_statistics(get_metric_opts).body['GetMetricStatisticsResult']['Datapoints']
|
||||
data.collect! { |datum| datum.merge('MetricName' => metricName, 'Namespace' => namespace, 'Dimensions' => dimensions) }
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue