Class: PumaCloudwatch::Metrics::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/puma_cloudwatch/metrics/fetcher.rb

Instance Method Summary collapse

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(options={})
  @control_url = options[:control_url]
  @control_auth_token = options[: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

#callObject



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