Module: Resque::Metrics::Hooks

Defined in:
lib/resque/metrics.rb

Instance Method Summary collapse

Instance Method Details

#after_enqueue_metrics(*args) ⇒ Object



347
348
349
# File 'lib/resque/metrics.rb', line 347

def after_enqueue_metrics(*args)
  Resque::Metrics.record_job_enqueue(self, *args)
end

#around_perform_metrics(*args) ⇒ Object



351
352
353
354
355
356
# File 'lib/resque/metrics.rb', line 351

def around_perform_metrics(*args)
  start = Time.now
  yield
  finish = ((Time.now.to_f - start.to_f) * 1000).to_i
  Resque::Metrics.record_job_completion(self, finish)
end

#on_failure_metrics(e, *args) ⇒ Object



358
359
360
# File 'lib/resque/metrics.rb', line 358

def on_failure_metrics(e, *args)
  Resque::Metrics.record_job_failure(self, e)
end