Class: Rack::MiniProfiler::TimerStruct::Custom
- Defined in:
- lib/mini_profiler/timer_struct/custom.rb
Overview
Timing system for a custom timers such as cache, redis, RPC, external API calls, etc.
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(type, duration_ms, page, parent) ⇒ Custom
constructor
A new instance of Custom.
Methods inherited from Base
#[], #[]=, #as_json, #attributes, #to_json
Constructor Details
#initialize(type, duration_ms, page, parent) ⇒ Custom
Returns a new instance of Custom.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mini_profiler/timer_struct/custom.rb', line 10 def initialize(type, duration_ms, page, parent) @parent = parent @page = page @type = type start_millis = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) * 1000).to_i - page[:started]) - duration_ms super( type: type, start_milliseconds: start_millis, duration_milliseconds: duration_ms, parent_timing_id: nil ) end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
9 10 11 |
# File 'lib/mini_profiler/timer_struct/custom.rb', line 9 def parent @parent end |