class Vitals::Reporters::StatsdReporter

Attributes

format[RW]
statsd[R]

Public Class Methods

new(host:'localhost', port:8125, format:nil) click to toggle source
# File lib/vitals/reporters/statsd_reporter.rb, line 8
def initialize(host:'localhost', port:8125, format:nil)
  @statsd = Statsd.new(host, port)
  @format = format
end

Public Instance Methods

count(m, v) click to toggle source
# File lib/vitals/reporters/statsd_reporter.rb, line 21
def count(m, v)
  @statsd.count(format.format(m), v)
end
gauge(m, v) click to toggle source
# File lib/vitals/reporters/statsd_reporter.rb, line 17
def gauge(m, v)
  @statsd.gauge(format.format(m), v)
end
inc(m) click to toggle source
# File lib/vitals/reporters/statsd_reporter.rb, line 13
def inc(m)
  @statsd.increment(format.format(m))
end
timing(m, v) click to toggle source
# File lib/vitals/reporters/statsd_reporter.rb, line 25
def timing(m, v)
  @statsd.timing(format.format(m), v)
end