class Vitals::Integrations::Notifications::Grape

Public Class Methods

event_name() click to toggle source
# File lib/vitals/integrations/notifications/grape.rb, line 5
def self.event_name
  'endpoint_run.grape'
end

Private Class Methods

handle(name, started, finished, unique_id, payload) click to toggle source
# File lib/vitals/integrations/notifications/grape.rb, line 11
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