Class: Sidekiq::Stats::History

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(days_previous, start_date = nil, pool: nil) ⇒ History

Returns a new instance of History.

Raises:

  • (ArgumentError)


179
180
181
182
183
184
# File 'lib/sidekiq/api.rb', line 179

def initialize(days_previous, start_date = nil, pool: nil)
  # we only store five years of data in Redis
  raise ArgumentError if days_previous < 1 || days_previous > (5 * 365)
  @days_previous = days_previous
  @start_date = start_date || Time.now.utc.to_date
end

Instance Method Details

#failedObject



190
191
192
# File 'lib/sidekiq/api.rb', line 190

def failed
  @failed ||= date_stat_hash("failed")
end

#processedObject



186
187
188
# File 'lib/sidekiq/api.rb', line 186

def processed
  @processed ||= date_stat_hash("processed")
end