Class: Rack::Insight::Instrumentation::Instrument::Timing
- Inherits:
-
Object
- Object
- Rack::Insight::Instrumentation::Instrument::Timing
- Defined in:
- lib/rack/insight/instrumentation/instrument.rb
Instance Attribute Summary collapse
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#request_start ⇒ Object
readonly
Returns the value of attribute request_start.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
- #delta_t ⇒ Object
- #duration ⇒ Object
-
#initialize(request_start, start, finish) ⇒ Timing
constructor
A new instance of Timing.
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
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
13 14 15 |
# File 'lib/rack/insight/instrumentation/instrument.rb', line 13 def finish @finish end |
#request_start ⇒ Object (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 |
#start ⇒ Object (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_t ⇒ Object
19 20 21 |
# File 'lib/rack/insight/instrumentation/instrument.rb', line 19 def delta_t @delta_t ||= ((@start - @request_start) * 1000).to_i end |
#duration ⇒ Object
15 16 17 |
# File 'lib/rack/insight/instrumentation/instrument.rb', line 15 def duration @duration ||= ((@finish - @start) * 1000).to_i end |