Class: Rack::Insight::Instrumentation::Instrument::Timing

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/insight/instrumentation/instrument.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_start, start, finish) ⇒ Timing

Returns a new instance of Timing.



9
10
11
# File 'lib/rack/insight/instrumentation/instrument.rb', line 9

def initialize(request_start, start, finish)
  @request_start, @start, @finish = request_start, start, finish
end

Instance Attribute Details

#finishObject (readonly)

Returns the value of attribute finish.



13
14
15
# File 'lib/rack/insight/instrumentation/instrument.rb', line 13

def finish
  @finish
end

#request_startObject (readonly)

Returns the value of attribute request_start.



13
14
15
# File 'lib/rack/insight/instrumentation/instrument.rb', line 13

def request_start
  @request_start
end

#startObject (readonly)

Returns the value of attribute start.



13
14
15
# File 'lib/rack/insight/instrumentation/instrument.rb', line 13

def start
  @start
end

Instance Method Details

#delta_tObject



19
20
21
# File 'lib/rack/insight/instrumentation/instrument.rb', line 19

def delta_t
  @delta_t ||= ((@start - @request_start) * 1000).to_i
end

#durationObject



15
16
17
# File 'lib/rack/insight/instrumentation/instrument.rb', line 15

def duration
  @duration ||= ((@finish - @start) * 1000).to_i
end