Class: Metrics::LoggerReporter

Inherits:
Reporter
  • Object
show all
Defined in:
lib/liquid/metrics/logger_reporter.rb

Instance Attribute Summary

Attributes inherited from Reporter

#duration_unit, #filter, #rate_unit

Instance Method Summary collapse

Methods inherited from Reporter

#convert_duration, #convert_rate, #report_counters, #report_gauges, #report_histograms, #report_meters, #report_timers, #run, #start, #stop

Constructor Details

#initialize(logger) ⇒ LoggerReporter

Returns a new instance of LoggerReporter.



6
7
8
9
10
# File 'lib/liquid/metrics/logger_reporter.rb', line 6

def initialize(logger)
  super
  @logger = logger
  @marker = "metrics:"
end

Instance Method Details

#report_counter(name, counter) ⇒ Object



16
17
18
# File 'lib/liquid/metrics/logger_reporter.rb', line 16

def report_counter(name, counter)
  @logger.info(@marker, super)
end

#report_gauge(name, gauge) ⇒ Object



12
13
14
# File 'lib/liquid/metrics/logger_reporter.rb', line 12

def report_gauge(name, gauge)
  @logger.info(@marker, super)
end

#report_histogram(name, histogram) ⇒ Object



20
21
22
# File 'lib/liquid/metrics/logger_reporter.rb', line 20

def report_histogram(name, histogram)
  @logger.info(@marker, super)
end

#report_meter(name, meter) ⇒ Object



24
25
26
# File 'lib/liquid/metrics/logger_reporter.rb', line 24

def report_meter(name, meter)
  @logger.info(@marker, super)
end

#report_timer(name, timer) ⇒ Object



28
29
30
# File 'lib/liquid/metrics/logger_reporter.rb', line 28

def report_timer(name, timer)
  @logger.info(@marker, super)
end