lib/tracebin/patches/sinatra.rb in tracebin-0.0.10 vs lib/tracebin/patches/sinatra.rb in tracebin-0.0.11
- old
+ new
@@ -1,18 +1,20 @@
::Sinatra::Base.class_eval do
alias_method :dispatch_without_tracebin!, :dispatch!
def dispatch!(*args, &block)
- start_time = Time.now
+ start_time = ::Tracebin::PatchHelper.timestamp_string
result = dispatch_without_tracebin!(*args, *block)
- end_time = Time.now
+ end_time = ::Tracebin::PatchHelper.timestamp_string
route = env['sinatra.route']
event_data = [
- 'sinatra.route_exec',
+ 'sinatra.route',
start_time,
end_time,
- route
+ {
+ endpoint: route
+ }
]
::Tracebin::Patches.handle_event :sinatra, event_data
result