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
[], double_dispatch, #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.
9 10 11 |
# File 'lib/gh/instrumentation.rb', line 9 def instrumenter @instrumenter end |
Instance Method Details
#[](key) ⇒ Object
25 26 27 |
# File 'lib/gh/instrumentation.rb', line 25 def [](key) instrument(:access, key:) { super } end |
#http(verb, url) ⇒ Object
17 18 19 |
# File 'lib/gh/instrumentation.rb', line 17 def http(verb, url, *) instrument(:http, verb:, url:) { super } end |
#load(data) ⇒ Object
21 22 23 |
# File 'lib/gh/instrumentation.rb', line 21 def load(data) instrument(:load, data:) { super } end |
#setup(backend, options) ⇒ Object
11 12 13 14 15 |
# File 'lib/gh/instrumentation.rb', line 11 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 |