Module: Excon::Instrumentation

Defined in:
lib/instruments.rb

Class Method Summary collapse

Class Method Details

.instrument(name, params = {}, &blk) ⇒ Object



110
111
112
113
114
115
116
117
118
119
# File 'lib/instruments.rb', line 110

def self.instrument(name, params={}, &blk)
  t0 = Time.now
  res = yield if block_given?
  t1 = Time.now
  Instruments.write(
    :lib => "excon",
    :action => "http-request",
    :elapsed => Integer((t1-t0)*1000)
  )
end