class Vitals::Reporters::InmemReporter

Attributes

format[RW]
reports[RW]

Public Class Methods

new() click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 6
def initialize
  flush
end

Public Instance Methods

flush() click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 10
def flush
  @reports = []
end
gauge(m, v) click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 18
def gauge(m, v)
  @reports << { :gauge => n( m ), :val => v }
end
inc(m) click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 14
def inc(m)
  @reports << { :inc => n( m ) }
end
timing(m, v) click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 22
def timing(m, v)
  @reports << { :timing => n( m ), :val => v }
end

Private Instance Methods

n(m) click to toggle source
# File lib/vitals/reporters/inmem_reporter.rb, line 27
def n(m)
  Vitals::Utils.normalize_metric(m)
end