Class: Sneakers::Metrics::LoggingMetrics

Inherits:
Object
  • Object
show all
Defined in:
lib/sneakers/metrics/logging_metrics.rb

Instance Method Summary collapse

Instance Method Details

#increment(metric) ⇒ Object



4
5
6
# File 'lib/sneakers/metrics/logging_metrics.rb', line 4

def increment(metric)
  Sneakers.logger.info("INC: #{metric}")
end

#timing(metric, &block) ⇒ Object



8
9
10
11
12
# File 'lib/sneakers/metrics/logging_metrics.rb', line 8

def timing(metric, &block)
  start = Time.now
  block.call
  Sneakers.logger.info("TIME: #{metric} #{Time.now - start}")
end