Sha256: 78337de63fc88e850842303df9a4aade5168d47be132f88bbf0f6f178336d23c
Contents?: true
Size: 922 Bytes
Versions: 15
Compression:
Stored size: 922 Bytes
Contents
require 'statsd' module Taskinator module LogStats class << self def initialize_client @client = Statsd.new() end def client defined?(@client) ? @client : initialize_client end def client=(statsd_client) @client = (statsd_client ? statsd_client : initialize_client) end def duration(stat, duration) client.timing(stat, duration * 1000) end def timing(stat, &block) result = nil duration = Benchmark.realtime do result = yield end duration(stat, duration) result end def gauge(stat, count) client.gauge(stat, count) end def count(stat, count) client.count(stat, count) end def increment(stat) client.increment(stat) end def decrement(stat) client.decrement(stat) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems