Sha256: 2b0195c8007fe5e2ba035581c6937cb0c1c96e08c1d37410d77d910c1bd4676f
Contents?: true
Size: 610 Bytes
Versions: 4
Compression:
Stored size: 610 Bytes
Contents
# frozen_string_literal: true module InstrumentAllTheThings module Instrumentors DEFAULT_EXECUTION_COUNT_AND_TIMING_OPTIONS = { }.freeze EXECUTION_COUNT_AND_TIMING_WRAPPER = proc do |opts, context| proc do |klass, next_blk, actual_code| InstrumentAllTheThings.increment("#{context.stats_name(klass)}.executed") InstrumentAllTheThings.time("#{context.stats_name(klass)}.duration") do next_blk.call(klass, actual_code) end rescue InstrumentAllTheThings.increment("#{context.stats_name(klass)}.errored") raise end end end end
Version data entries
4 entries across 4 versions & 1 rubygems