Sha256: 1adbb52ca7c11620b15d91e38117beee4d36b79ea1a113877f1685de26a01975

Contents?: true

Size: 793 Bytes

Versions: 18

Compression:

Stored size: 793 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'
require 'statsd'

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)
        if self.class.client
          self.class.client.increment metric
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
flipper-0.9.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.9.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.9.0.beta1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.8.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.5 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.4 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.3 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta6 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta5 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta4 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta3 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta2 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.7.0.beta1 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.6.3 lib/flipper/instrumentation/statsd_subscriber.rb
flipper-0.6.2 lib/flipper/instrumentation/statsd_subscriber.rb