Class: GH::Instrumentation
Overview
Public: This class caches responses.
Instance Attribute Summary collapse
-
#instrumenter ⇒ Object
Public: Get/set instrumenter to use.
Attributes inherited from Wrapper
Instance Method Summary collapse
Methods inherited from Wrapper
[], #frontend, #frontend=, #generate_response, #initialize, #inspect, #prefixed, #reset, wraps
Constructor Details
This class inherits a constructor from GH::Wrapper
Instance Attribute Details
#instrumenter ⇒ Object
Public: Get/set instrumenter to use. Compatible with ActiveSupport::Notification and Travis::EventLogger.
7 8 9 |
# File 'lib/gh/instrumentation.rb', line 7 def instrumenter @instrumenter end |
Instance Method Details
#[](key) ⇒ Object
23 24 25 |
# File 'lib/gh/instrumentation.rb', line 23 def [](key) instrument(:access, :key => key) { super } end |
#http(verb, url) ⇒ Object
15 16 17 |
# File 'lib/gh/instrumentation.rb', line 15 def http(verb, url, *) instrument(:http, :verb => verb, :url => url) { super } end |
#load(data) ⇒ Object
19 20 21 |
# File 'lib/gh/instrumentation.rb', line 19 def load(data) instrument(:load, :data => data) { super } end |
#setup(backend, options) ⇒ Object
9 10 11 12 13 |
# File 'lib/gh/instrumentation.rb', line 9 def setup(backend, ) self.instrumenter ||= Travis::EventLogger.method(:notify) if defined? Travis::EventLogger self.instrumenter ||= ActiveSupport::Notifications.method(:instrument) if defined? ActiveSupport::Notifications super end |