Sha256: c8df8cc03cbf09856389621d5ee0dfda12e15a02a206c896a2ce6d185e1ce0b4
Contents?: true
Size: 724 Bytes
Versions: 21
Compression:
Stored size: 724 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| context.tags ||= [] InstrumentAllTheThings.increment("#{context.stats_name(klass)}.executed", { tags: context.tags }) InstrumentAllTheThings.time("#{context.stats_name(klass)}.duration", { tags: context.tags }) do next_blk.call(klass, actual_code) end rescue StandardError InstrumentAllTheThings.increment("#{context.stats_name(klass)}.errored", { tags: context.tags }) raise end end end end
Version data entries
21 entries across 21 versions & 1 rubygems