Concurrent::Map.new
9 10 11 12 13
# File 'lib/pika_que/metrics/log_metric.rb', line 9 def increment(metric, delta = 1) COUNTERS[metric] = 0 unless COUNTERS[metric] COUNTERS[metric] = COUNTERS[metric] + delta PikaQue.logger.info("COUNT: #{metric} #{COUNTERS[metric]}") end
15 16 17 18 19
# File 'lib/pika_que/metrics/log_metric.rb', line 15 def measure(metric, &block) start = Time.now block.call PikaQue.logger.info("TIME: #{metric} #{Time.now - start}") end