Skip to content

Instantly share code, notes, and snippets.

@mauu-alpha
Last active February 8, 2017 19:19
Show Gist options
  • Save mauu-alpha/1af51ee70137e1980a882523d7f7bdba to your computer and use it in GitHub Desktop.
Save mauu-alpha/1af51ee70137e1980a882523d7f7bdba to your computer and use it in GitHub Desktop.
# config.ru
use Statue::RackStatistics # https://github.com/restorando/statue/blob/master/lib/statue/rack_statistics.rb
# app
Cuba.define do
on get do
on "restaurant/:id/reviews" do
res.write "All reviews"
end
end
end
# metrics generated
# I, [2017-02-08T16:03:59.479898 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-66-reviews:0.0003519998863339424|ms
# I, [2017-02-08T16:03:59.479970 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-66-reviews.status-200:1|c
# I, [2017-02-08T16:03:59.479998 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-66-reviews.success:1|c
# metrics expected
# I, [2017-02-08T16:03:59.479898 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-reviews:0.0003519998863339424|ms
# I, [2017-02-08T16:03:59.479970 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-reviews.status-200:1|c
# I, [2017-02-08T16:03:59.479998 #71331] INFO -- Statue: foodie-api.request.GET.restaurant-reviews.success:1|c
# I guess the question is: "How can i get the static part of the route, stripping the dynamic parameters?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment