Class: SidekiqHero::Recorder
- Inherits:
-
Object
- Object
- SidekiqHero::Recorder
- Defined in:
- lib/sidekiq_hero/recorder.rb
Instance Attribute Summary collapse
-
#meta_data ⇒ Object
readonly
Returns the value of attribute meta_data.
Instance Method Summary collapse
-
#initialize ⇒ Recorder
constructor
A new instance of Recorder.
- #record(hash) ⇒ Object
- #record_elapsed_time ⇒ Object
Constructor Details
#initialize ⇒ Recorder
Returns a new instance of Recorder.
7 8 9 |
# File 'lib/sidekiq_hero/recorder.rb', line 7 def initialize = {} end |
Instance Attribute Details
#meta_data ⇒ Object (readonly)
Returns the value of attribute meta_data.
5 6 7 |
# File 'lib/sidekiq_hero/recorder.rb', line 5 def end |
Instance Method Details
#record(hash) ⇒ Object
11 12 13 |
# File 'lib/sidekiq_hero/recorder.rb', line 11 def record(hash) .merge!(hash) end |
#record_elapsed_time ⇒ Object
15 16 17 18 |
# File 'lib/sidekiq_hero/recorder.rb', line 15 def record_elapsed_time total = .fetch(:ended_at, 0) - .fetch(:started_at, 0) record(total_time: total) end |