Sha256: 889d7adedebe4cf463c6dbb36e7b63fb7b21eeaaca2565207e4cec7e9689bea6

Contents?: true

Size: 692 Bytes

Versions: 10

Compression:

Stored size: 692 Bytes

Contents

# Note: You should never need to require this file directly if you are using
# ActiveSupport::Notifications. Instead, you should require the statsd file
# that lives in the same directory as this file. The benefit is that it
# subscribes to the correct events and does everything for your.
require 'flipper/instrumentation/subscriber'

module Flipper
  module Instrumentation
    class StatsdSubscriber < Subscriber
      class << self
        attr_accessor :client
      end

      def update_timer(metric)
        self.class.client&.timing metric, (@duration * 1_000).round
      end

      def update_counter(metric)
        self.class.client&.increment metric
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flipper-1.3.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.3.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.3.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.3.0.pre lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.2.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.2.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.2.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.1.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.1.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-1.1.0 lib/flipper/instrumentation/statsd_subscriber.rb