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