Class: PumaCloudwatch::Metrics::Fetcher
- Inherits:
-
Object
- Object
- PumaCloudwatch::Metrics::Fetcher
- Defined in:
- lib/puma_cloudwatch/metrics/fetcher.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(options = {}) ⇒ Fetcher
Returns a new instance of Fetcher.
8 9 10 11 12 13 14 15 |
# File 'lib/puma_cloudwatch/metrics/fetcher.rb', line 8 def initialize(={}) @control_url = [:control_url] @control_auth_token = [:control_auth_token] if ENV['PUMA_CLOUDWATCH_DEBUG'] puts "puma control_url #{@control_url}" puts "puma control_auth_token #{@control_auth_token}" end end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/puma_cloudwatch/metrics/fetcher.rb', line 17 def call body = with_retries do read_data end JSON.parse(body.split("\n").last) # stats end |