Sha256: 9ed4895d9e858170ccdda93ca44e61165dbfbf74c26884036fda68eb17affa73

Contents?: true

Size: 612 Bytes

Versions: 11

Compression:

Stored size: 612 Bytes

Contents

require 'vitals/integrations/notifications/base'

module Vitals::Integrations::Notifications
  class Grape < Base
    def self.event_name
      'endpoint_run.grape'
    end

    private

    def self.handle(name, started, finished, unique_id, payload)
      endpoint = payload[:endpoint]
      route    = endpoint.route
      method   = route.route_method.downcase

      path = Vitals::Utils.grape_path(route)

      # TODO move 'grape' to configuration opts in subscribe!(opts)
      m = "grape.#{path}.#{method}.#{endpoint.status}.all"
      Vitals.timing(m, duration(started, finished))
    end

  end
end


Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vitals-0.12.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.11.1 lib/vitals/integrations/notifications/grape.rb
vitals-0.11.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.10.1 lib/vitals/integrations/notifications/grape.rb
vitals-0.10.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.9.1 lib/vitals/integrations/notifications/grape.rb
vitals-0.9.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.8.1 lib/vitals/integrations/notifications/grape.rb
vitals-0.8.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.7.0 lib/vitals/integrations/notifications/grape.rb
vitals-0.6.0 lib/vitals/integrations/notifications/grape.rb