2011-05-19 06:37:45 -04:00
|
|
|
Shindo.tests('AWS::CloudWatch | metric requests', ['aws', 'cloudwatch']) do
|
|
|
|
tests('success') do
|
2011-07-20 13:11:10 -04:00
|
|
|
|
2011-05-19 06:37:45 -04:00
|
|
|
@metrics_statistic_format = {
|
|
|
|
'GetMetricStatisticsResult' => {
|
|
|
|
'Label' => String,
|
|
|
|
'Datapoints' => [{
|
|
|
|
"Timestamp" => Time,
|
|
|
|
'Unit' => String,
|
|
|
|
'Minimum' => Float,
|
|
|
|
'Maximum' => Float,
|
|
|
|
'Average' => Float,
|
|
|
|
'Sum' => Float,
|
|
|
|
'SampleCount' => Float
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
'ResponseMetadata' => {
|
|
|
|
'RequestId' => String
|
|
|
|
}
|
|
|
|
}
|
2011-07-20 13:11:10 -04:00
|
|
|
|
2011-05-19 06:37:45 -04:00
|
|
|
tests("#get_metric_statistics").formats(@metrics_statistic_format) do
|
2011-07-20 13:11:10 -04:00
|
|
|
pending if Fog.mocking?
|
2011-05-19 06:37:45 -04:00
|
|
|
instanceId = 'i-420c352f'
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:cloud_watch].get_metric_statistics({'Statistics' => ['Minimum','Maximum','Sum','SampleCount','Average'], 'StartTime' => (Time.now-600).iso8601, 'EndTime' => Time.now.iso8601, 'Period' => 60, 'MetricName' => 'DiskReadBytes', 'Namespace' => 'AWS/EC2', 'Dimensions' => [{'Name' => 'InstanceId', 'Value' => instanceId}]}).body
|
2011-05-19 06:37:45 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|