Sha256: 90f4aacbe9d4d878ba5108123d12a69dbe23a8fc8b8929c37cdb472dd9bcd542

Contents?: true

Size: 500 Bytes

Versions: 8

Compression:

Stored size: 500 Bytes

Contents

module Librato
  module Rails
    module Subscribers
      hooks = %w{enqueue_at enqueue perform_start perform}

      hooks.each do |hook|
        ActiveSupport::Notifications.subscribe "#{hook}.active_job" do |*args|
          event = ActiveSupport::Notifications::Event.new(*args)

          collector.group 'rails.job' do |c|
            c.increment hook
            c.timing "#{hook}.time", event.duration, source: event.payload[:job].class
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
librato-rails-1.4.2 lib/librato/rails/subscribers/job.rb
librato-rails-1.4.1 lib/librato/rails/subscribers/job.rb
librato-rails-1.4.0 lib/librato/rails/subscribers/job.rb
librato-rails-1.4.0.beta lib/librato/rails/subscribers/job.rb
librato-rails-1.3.0 lib/librato/rails/subscribers/job.rb
librato-rails-1.2.0 lib/librato/rails/subscribers/job.rb
librato-rails-1.1.0 lib/librato/rails/subscribers/job.rb
librato-rails-1.0.0 lib/librato/rails/subscribers/job.rb