Sha256: 75cfaa598763515fb0398cb5aa89787c2fc22dcd0fd3056809145ed412f4bdf9

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

require "nunes/subscriber"

module Nunes
  module Subscribers
    class ActionMailer < ::Nunes::Subscriber
      # Private
      Pattern = /\.action_mailer\Z/

      # Private: The namespace for events to subscribe to.
      def self.pattern
        Pattern
      end

      def deliver(start, ending, transaction_id, payload)
        runtime = ((ending - start) * 1_000).round
        mailer = payload[:mailer]

        if mailer
          timing "action_mailer.deliver.#{mailer.to_s.underscore}", runtime
        end
      end

      def receive(start, ending, transaction_id, payload)
        runtime = ((ending - start) * 1_000).round
        mailer = payload[:mailer]

        if mailer
          timing "action_mailer.receive.#{mailer.to_s.underscore}", runtime
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nunes-0.1.0 lib/nunes/subscribers/action_mailer.rb