Class: SidekiqHero::Recorder

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_hero/recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRecorder

Returns a new instance of Recorder.



7
8
9
# File 'lib/sidekiq_hero/recorder.rb', line 7

def initialize
   = {}
end

Instance Attribute Details

#meta_dataObject (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_timeObject



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