Module: Resque::Plugins::JobStats::Performed
- Included in:
- Resque::Plugins::JobStats
- Defined in:
- lib/resque/plugins/job_stats/performed.rb
Overview
Extend your job with this module to track how many jobs are performed successfully
Instance Method Summary collapse
-
#after_perform_job_stats_performed(*args) ⇒ Object
Increments the performed count when job is complete.
-
#jobs_performed ⇒ Object
Returns the number of jobs performed.
-
#jobs_performed=(int) ⇒ Object
Sets the number of jobs performed.
-
#jobs_performed_key ⇒ Object
Returns the key used for tracking jobs performed.
Instance Method Details
#after_perform_job_stats_performed(*args) ⇒ Object
Increments the performed count when job is complete
25 26 27 |
# File 'lib/resque/plugins/job_stats/performed.rb', line 25 def after_perform_job_stats_performed(*args) Resque.redis.incr(jobs_performed_key) end |
#jobs_performed ⇒ Object
Returns the number of jobs performed
15 16 17 |
# File 'lib/resque/plugins/job_stats/performed.rb', line 15 def jobs_performed Resque.redis.get(jobs_performed_key).to_i end |
#jobs_performed=(int) ⇒ Object
Sets the number of jobs performed
10 11 12 |
# File 'lib/resque/plugins/job_stats/performed.rb', line 10 def jobs_performed=(int) Resque.redis.set(jobs_performed_key,int) end |
#jobs_performed_key ⇒ Object
Returns the key used for tracking jobs performed
20 21 22 |
# File 'lib/resque/plugins/job_stats/performed.rb', line 20 def jobs_performed_key "stats:jobs:#{self.name}:performed" end |