Class: Cloudwatch::Sender::Fetcher::SQS
- Inherits:
-
Object
- Object
- Cloudwatch::Sender::Fetcher::SQS
- Defined in:
- lib/cloudwatch/sender/fetcher/sqs.rb
Constant Summary collapse
- START_TIME =
1200
Instance Attribute Summary collapse
-
#cloudwatch ⇒ Object
readonly
Returns the value of attribute cloudwatch.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
Instance Method Summary collapse
-
#initialize(cloudwatch, sender) ⇒ SQS
constructor
A new instance of SQS.
- #metrics(component_meta, metric) ⇒ Object
Constructor Details
#initialize(cloudwatch, sender) ⇒ SQS
Returns a new instance of SQS.
7 8 9 10 |
# File 'lib/cloudwatch/sender/fetcher/sqs.rb', line 7 def initialize(cloudwatch, sender) @cloudwatch = cloudwatch @sender = sender end |
Instance Attribute Details
#cloudwatch ⇒ Object (readonly)
Returns the value of attribute cloudwatch.
5 6 7 |
# File 'lib/cloudwatch/sender/fetcher/sqs.rb', line 5 def cloudwatch @cloudwatch end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
5 6 7 |
# File 'lib/cloudwatch/sender/fetcher/sqs.rb', line 5 def sender @sender end |
Instance Method Details
#metrics(component_meta, metric) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cloudwatch/sender/fetcher/sqs.rb', line 14 def metrics(, metric) resp = cloudwatch.get_metric_statistics( :namespace => ["namespace"], :metric_name => metric["name"], :dimensions => [{ :name => "QueueName", :value => ["queue_name"] }], :start_time => Time.now - START_TIME, :end_time => Time.now, :period => 60, :statistics => metric["statistics"], :unit => metric["unit"] ) name = ["namespace"].downcase name_metrics(resp, name, metric["statistics"], ["queue_name"]) end |