lib/bm/instrumentations/timings/metrics_collection.rb
def observe(method)
          stopwatch = Stopwatch.started
          begin
            yield.tap { record_call(method: method, stopwatch: stopwatch) }
          rescue StandardError
            record_call(method: method, stopwatch: stopwatch, status: 'failure')
            raise
          end
        end
# Invokes and then record metrics for an invoked ruby's method
#
# @example
#   metrics_collection.observe(:long_running_job) { long_running_job }
#
# @param method [Symbol]
Invokes and then record metrics for an invoked ruby's method
Invokes and then record metrics for an invoked ruby ' s method
def observe(method)
          stopwatch = Stopwatch.started
          begin
            yield.tap { record_call(method: method, stopwatch: stopwatch) }
          rescue StandardError
            record_call(method: method, stopwatch: stopwatch, status: 'failure')
            raise
          end
        end
def observe ( method ) stopwatch = Stopwatch . started begin yield . tap { record_call ( method : method , stopwatch : stopwatch ) } rescue StandardError record_call ( method : method , stopwatch : stopwatch , status : 'failure' ) raise end end
Invokes and then record metrics for an invoked ruby's method
Invokes and then record metrics for an invoked ruby ' s method
method
None
example
metrics_collection.observe(:long_running_job) { long_running_job }
metrics_collection . observe ( : long_running_job ) { long_running_job }