Sha256: 0e238bac4536f104a55124e3c691be80deb20f1f83695c09dd81228491f985c0
Contents?: true
Size: 864 Bytes
Versions: 4
Compression:
Stored size: 864 Bytes
Contents
require "action_view" class AwsInventory::Cloudwatch < AwsInventory::Base include ActionView::Helpers::DateHelper def header ["Alarm Name", "Threshold"] end def data alarms.map do |alarm| [ alarm.alarm_name, threshold_desc(alarm) ] end end def threshold_desc(alarm) a = alarm total_period = a.period * a.evaluation_periods time_in_words = distance_of_time_in_words(total_period) "#{a.metric_name} #{compare_map[a.comparison_operator]} #{a.threshold} for #{a.evaluation_periods} datapoints within #{time_in_words}" end def compare_map { "GreaterThanOrEqualToThreshold" => ">=", "GreaterThanThreshold" => ">", "LessThanOrEqualToThreshold" => "<=", "LessThanThreshold" => "<", } end def alarms @alarms ||= cw.describe_alarms.metric_alarms end end
Version data entries
4 entries across 4 versions & 1 rubygems