Sha256: d4ff9919223884620883190c0633b87862dd671fedc5fbab9abf4cce4e133c2d
Contents?: true
Size: 583 Bytes
Versions: 6
Compression:
Stored size: 583 Bytes
Contents
module Racecar ## # Common API for instrumentation to standardize # namespace and default payload # class Instrumenter NAMESPACE = "racecar" attr_reader :backend def initialize(default_payload = {}) @default_payload = default_payload @backend = if defined?(ActiveSupport::Notifications) ActiveSupport::Notifications else NullInstrumenter end end def instrument(event_name, payload = {}, &block) @backend.instrument("#{event_name}.#{NAMESPACE}", @default_payload.merge(payload), &block) end end end
Version data entries
6 entries across 6 versions & 1 rubygems