class Vitals::Reporters::ConsoleReporter
Attributes
format[RW]
Public Class Methods
new(category:'main', output: $stdout, format:nil)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 5 def initialize(category:'main', output: $stdout, format:nil) @format = format @category = category @output = output end
Public Instance Methods
count(m, v)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 19 def count(m, v) print "#{@category} COUNT #{self.format.format(m)} #{v}" end
gauge(m, v)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 15 def gauge(m, v) print "#{@category} GAUGE #{self.format.format(m)} #{v}" end
inc(m)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 11 def inc(m) print "#{@category} INC #{self.format.format(m)}" end
print(str)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 27 def print(str) @output.printf("#{ str }\n") end
timing(m, v)
click to toggle source
# File lib/vitals/reporters/console_reporter.rb, line 23 def timing(m, v) print "#{@category} TIME #{self.format.format(m)} #{v}" end