class Suricate::Newrelic::ApplicationStatusCollector

Public Class Methods

new(options = {}) click to toggle source
# File lib/suricate/newrelic/collectors/application_status_collector.rb, line 3
def initialize(options = {})
  @client  = Client.new(options[:api_key])
  @app_id  = options[:app_id]
end

Public Instance Methods

populate(response, options = {}) click to toggle source
# File lib/suricate/newrelic/collectors/application_status_collector.rb, line 8
def populate(response, options = {})
  status = application.status
  if status.ok?
    response.ok!
  elsif status.warning?
    response.warning!
  elsif status.alert?
    response.alert!
  end
end

Private Instance Methods

application() click to toggle source
# File lib/suricate/newrelic/collectors/application_status_collector.rb, line 20
def application
  @client.get_application(@app_id)
end