Sha256: 0a6c6d45c5969194b0b819d15096c0585f2f25f15cbbe93dc2156b7b29579b10

Contents?: true

Size: 785 Bytes

Versions: 15

Compression:

Stored size: 785 Bytes

Contents

require 'new_relic/agent/method_tracer'

module QueueClassicNewRelic
  include NewRelic::Agent::Instrumentation::ControllerInstrumentation

  def new_relic_key
    "Custom/QueueClassicPlus/#{librato_key}"
  end

  def _perform(*args)
    opts = {
      name: 'perform',
      class_name: self.name,
      category: 'OtherTransaction/QueueClassicPlus',
    }

    perform_action_with_newrelic_trace(opts) do
      if NewRelic::Agent.config[:'queue_classic_plus.capture_params']
        NewRelic::Agent.add_custom_parameters(job_arguments: args)
      end

      super
    end
  end

  QueueClassicPlus::Base.singleton_class.send(:prepend, QueueClassicNewRelic)
end

QueueClassicPlus::CustomWorker.class_eval do
  def initialize(*)
    ::NewRelic::Agent.manual_start
    super
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
queue_classic_plus-4.0.0.alpha21 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha20 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha19 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha18 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha17 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha16 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha15 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha14 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha13 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha12 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha11 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha10 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha9 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-4.0.0.alpha8 lib/queue_classic_plus/new_relic.rb
queue_classic_plus-1.1.0 lib/queue_classic_plus/new_relic.rb