Class: Honeybadger::Plugin::CollectorExecution Private
- Includes:
- InstrumentationHelper
- Defined in:
- lib/honeybadger/plugin.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- DEFAULT_COLLECTION_INTERVAL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
60
Instance Method Summary collapse
-
#initialize(name, config, options, &block) ⇒ CollectorExecution
constructor
private
A new instance of CollectorExecution.
- #register! ⇒ Object private
- #reset ⇒ Object private
- #tick ⇒ Object private
Methods included from InstrumentationHelper
#decrement_counter, #extract_attributes, #extract_callable, #gauge, #histogram, #increment_counter, #metric_agent, #metric_attributes, #metric_instrumentation, #metric_source, #monotonic_timer, #time
Methods inherited from Execution
Constructor Details
#initialize(name, config, options, &block) ⇒ CollectorExecution
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of CollectorExecution.
136 137 138 139 140 141 142 143 |
# File 'lib/honeybadger/plugin.rb', line 136 def initialize(name, config, , &block) @name = name @config = config @options = @block = block @interval = config.collection_interval(name) || .fetch(:interval, DEFAULT_COLLECTION_INTERVAL) @end_time = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) + @interval end |
Instance Method Details
#register! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
153 154 155 |
# File 'lib/honeybadger/plugin.rb', line 153 def register! Honeybadger.collect(self) end |
#reset ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
149 150 151 |
# File 'lib/honeybadger/plugin.rb', line 149 def reset @end_time = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) + @interval end |
#tick ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
145 146 147 |
# File 'lib/honeybadger/plugin.rb', line 145 def tick @end_time - ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) end |