Sha256: 715c1c3116e9c3932f7341db2cab0802c8f90b2a3b89b3a04d324f958a2b1e36

Contents?: true

Size: 754 Bytes

Versions: 61

Compression:

Stored size: 754 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)
        if self.class.client
          self.class.client.timing metric, (@duration * 1_000).round
        end
      end

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

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
flipper-0.17.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.16.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.16.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.16.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.15.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.14.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.13.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.13.0.beta1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.12.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.12.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.12.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.rc1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta9 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta8 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta7 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta6 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta5 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta4 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.11.0.beta3 lib/flipper/instrumentation/statsd_subscriber.rb