Sha256: 9f4073691958b582b76ef9c8b4a234c266011d7049021b70fe3555b40d96fee7

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

require 'vitals/integrations/notifications/base'

module Vitals::Integrations::Notifications
  class ActionController < Base
    def self.event_name
      'process_action.action_controller'
    end

    private

    def self.handle(name, started, finished, unique_id, payload)
      method  = payload[:method].downcase
      status  = payload[:status]
      action  = payload[:action]
      ctrl    = payload[:controller].sub(/Controller$/, '').downcase
      # format  = payload[:format]

      m = "controllers.#{ctrl}_#{action}_#{method}.#{status}"
      Vitals.timing("#{m}.all", duration(started, finished))
      Vitals.timing("#{m}.db", payload[:db_runtime]) if payload[:db_runtime]
      Vitals.timing("#{m}.view", payload[:view_runtime]) if payload[:view_runtime]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vitals-0.5.0 lib/vitals/integrations/notifications/action_controller.rb
vitals-0.4.0 lib/vitals/integrations/notifications/action_controller.rb
vitals-0.3.0 lib/vitals/integrations/notifications/action_controller.rb