Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: seanmoon/grape-librato
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: teespring-labs/grape-librato
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 19, 2016

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d846cbd View commit details
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/grape-librato/middleware.rb
9 changes: 8 additions & 1 deletion lib/grape-librato/middleware.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,14 @@ def initialize(app)

def call(env)
req = ::Rack::Request.new(env)
request_path = env['api.endpoint'].routes.first.route_path[1..-1].gsub("/", ".").sub(/\(\.:format\)\z/, "")
request_path =
env['api.endpoint'].
routes.
first.
path[1..-1].
gsub("/", ".").
sub(/\(\.:format\)\z/, "")

metric_name = "grape.#{req.request_method}.#{request_path}"
Librato.increment metric_name
Librato.timing "#{metric_name}.time" do