Sha256: a2be7e0a9863ab52a7600bc5a3efb3f163558841bea1eb9668c110841911c22a
Contents?: true
Size: 808 Bytes
Versions: 2
Compression:
Stored size: 808 Bytes
Contents
# Note: You should never need to require this file directly if you are using # ActiveSupport::Notifications. Instead, you should require the metriks 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 "twirl/instrumentation/subscriber" require "statsd" module Twirl 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, value = 1) if self.class.client self.class.client.increment metric, value end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
twirl-0.2.0 | lib/twirl/instrumentation/statsd_subscriber.rb |
twirl-0.1.0 | lib/twirl/instrumentation/statsd_subscriber.rb |