Module: NewRelic::Agent::Instrumentation::Sinatra::NewRelic
- Extended by:
- NewRelic
- Included in:
- NewRelic
- Defined in:
- lib/new_relic/agent/instrumentation/sinatra.rb
Instance Method Summary collapse
Instance Method Details
#http_verb(request) ⇒ Object
55 56 57 |
# File 'lib/new_relic/agent/instrumentation/sinatra.rb', line 55 def http_verb(request) request.request_method if request.respond_to?(:request_method) end |
#transaction_name(routes, request) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_relic/agent/instrumentation/sinatra.rb', line 59 def transaction_name(routes, request) name = '(unknown)' verb = http_verb(request) Array(routes[verb]).each do |pattern, keys, conditions, block| if pattern = yield(pattern, keys, conditions) name = pattern end end name.gsub!(%r{^[/^]*(.*?)[/\$\?]*$}, '\1') if verb name = verb + ' ' + name end name end |