Sha256: 01d93be8c3347abd63a22dd62b381896aef965c783c1e3cc4c9e5e108a18e0ac

Contents?: true

Size: 1.59 KB

Versions: 103

Compression:

Stored size: 1.59 KB

Contents

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 = Fog::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
    
    new_attributes = {
      :namespace => 'Custom/Test',
      :metric_name => 'ModelTest',
      :value => 9,
      :unit => 'None'
    }
    tests('#new').returns(new_attributes) do
      Fog::AWS[:cloud_watch].metric_statistics.new(new_attributes).attributes
    end
    
    tests('#create').returns(new_attributes) do
      Fog::AWS[:cloud_watch].metric_statistics.create(new_attributes).attributes
    end
    
    stats_set_attributes = {
      :namespace => 'Custom/Test',
      :metric_name => 'ModelTest',
      :minimum => 0,
      :maximum => 4,
      :sum => 10,
      :sample_count => 5,
      :average => 2,
      :unit => 'None'
    }
    tests('#create_stats_set').returns(stats_set_attributes) do
      Fog::AWS[:cloud_watch].metric_statistics.create(stats_set_attributes).attributes
    end
  end

end

Version data entries

103 entries across 103 versions & 17 rubygems

Version Path
fog-maestrodev-1.18.0.20131209090811 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131121075022 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/aws/models/cloud_watch/metric_statistics_tests.rb
gapinc-fog-1.12.1.2.1 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-1.18.0 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-1.17.0 tests/aws/models/cloud_watch/metric_statistics_tests.rb
fog-1.16.0 tests/aws/models/cloud_watch/metric_statistics_tests.rb