Sha256: 97fb83f1cae082114fae8fd856f963ba56a36f5fd757b639b6ea86a0f2a38010

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

module HeimdallApm
  module ActionController
    class Subscriber
      def start(name, id, payload)
        txn     = ::HeimdallApm::TransactionManager.current
        scope   = -"#{payload[:controller]}##{payload[:action]}"
        segment = ::HeimdallApm::Segment.new('Controller'.freeze, scope)

        txn.scope = scope unless txn.scope
        txn.start_segment(segment)
      end

      def finish(name, id, payload)
        txn = ::HeimdallApm::TransactionManager.current
        txn.stop_segment
      end
    end
  end
end

ActiveSupport::Notifications.subscribe(
  'process_action.action_controller',
  ::HeimdallApm::ActionController::Subscriber.new
)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
heimdall_apm-0.1.2 lib/heimdall_apm/instruments/action_controller.rb
heimdall_apm-0.1.1 lib/heimdall_apm/instruments/action_controller.rb
heimdall_apm-0.1.0 lib/heimdall_apm/instruments/action_controller.rb