class GH::Instrumentation

Public: This class caches responses.

def [](key)

def [](key)
  instrument(:access, :key => key) { super }
end

def http(verb, url, *)

def http(verb, url, *)
  instrument(:http, :verb => verb, :url => url) { super }
end

def instrument(type, payload = {})

def instrument(type, payload = {})
  return yield unless instrumenter
  result = nil
  instrumenter.call("#{type}.gh", payload.merge(:gh => frontend)) { result = yield }
  return result
end

def load(data)

def load(data)
  instrument(:load, :data => data) { super }
end

def setup(backend, options)

def setup(backend, options)
  self.instrumenter ||= Travis::EventLogger.method(:notify)              if defined? Travis::EventLogger
  self.instrumenter ||= ActiveSupport::Notifications.method(:instrument) if defined? ActiveSupport::Notifications
  super
end