Class: Resque::Job
- Inherits:
-
Object
- Object
- Resque::Job
- Defined in:
- lib/enqueue_time.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/enqueue_time.rb', line 35 def perform begin if payload['enqueued_at'] queue_time = (Time.now - DateTime.parse(payload['enqueued_at'])) * 1000.0 StatsdHelper.statsd.timing("queues.#{queue}.queue_time", queue_time) StatsdHelper.statsd.timing("total.queue_time", queue_time) end rescue Exception => e Rails.logger.error "Error in Resque::EnqueueTime in recording queue_time in statsd: #{e.}" end perform_without_enqueue_time end |
#perform_without_enqueue_time ⇒ Object
33 |
# File 'lib/enqueue_time.rb', line 33 alias_method :perform_without_enqueue_time, :perform |