Class: SidekiqJobStats::Enqueued

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_job_stats/enqueued.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_class) ⇒ Enqueued

Returns a new instance of Enqueued.



5
6
7
# File 'lib/sidekiq_job_stats/enqueued.rb', line 5

def initialize(job_class)
  @job_class = job_class
end

Instance Attribute Details

#job_classObject

Returns the value of attribute job_class.



3
4
5
# File 'lib/sidekiq_job_stats/enqueued.rb', line 3

def job_class
  @job_class
end

Instance Method Details

#jobs_enqueuedObject



15
16
17
18
19
# File 'lib/sidekiq_job_stats/enqueued.rb', line 15

def jobs_enqueued
  Sidekiq.redis do |conn|
    conn.get(job_stats_enqueued_key).to_i
  end
end

#trackObject



9
10
11
12
13
# File 'lib/sidekiq_job_stats/enqueued.rb', line 9

def track
  Sidekiq.redis do |conn|
    conn.incr(job_stats_enqueued_key)
  end
end