mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
23 lines
No EOL
810 B
Ruby
23 lines
No EOL
810 B
Ruby
Shindo.tests("AWS::CloudWatch | metric_statistics", ['aws', 'cloudwatch']) do
|
|
|
|
tests('success') do
|
|
pending if Fog.mocking?
|
|
|
|
instanceId = 'i-420c352f'
|
|
metricName = 'DiskReadBytes'
|
|
namespace = 'AWS/EC2'
|
|
startTime = (Time.now-600).iso8601
|
|
endTime = Time.now.iso8601
|
|
period = 60
|
|
statisticTypes = ['Minimum','Maximum','Sum','SampleCount','Average']
|
|
|
|
tests("#all").succeeds do
|
|
@statistics = AWS[:cloud_watch].metric_statistics.all({'Statistics' => statisticTypes, 'StartTime' => startTime, 'EndTime' => endTime, 'Period' => period, 'MetricName' => metricName, 'Namespace' => namespace, 'Dimensions' => [{'Name' => 'InstanceId', 'Value' => instanceId}]})) end
|
|
|
|
tests("#all_not_empty").returns(true) do
|
|
@statistics.length > 0
|
|
end
|
|
|
|
end
|
|
|
|
end |