Module: D13n::Metric::Instrumentation::ControllerInstrumentation
- Included in:
- Sinatra
- Defined in:
- lib/d13n/metric/instrumentation/controller_instrumentation.rb
Defined Under Namespace
Classes: StreamNamer
Instance Method Summary collapse
Instance Method Details
#perform_action_with_d13n_stream(*args, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/d13n/metric/instrumentation/controller_instrumentation.rb', line 5 def perform_action_with_d13n_stream(*args, &block) return yield unless ::D13n::Metric::Helper.http_in_tracable? state = D13n::Metric::StreamState.st_get state.request = metric_request(args) = args.last.is_a?(Hash) ? args.last : {} category = [:category] || :action = (, category, state) begin stream = D13n::Metric::Stream.start(state, category, ) begin yield rescue => e D13n::Metric::Manager.notice_error(e) raise end ensure D13n::Metric::Stream.stop(state) end end |