Class: Vitals::Reporters::InmemReporter

Inherits:
BaseReporter show all
Defined in:
lib/vitals/reporters/inmem_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseReporter

#time

Constructor Details

#initializeInmemReporter

Returns a new instance of InmemReporter.



6
7
8
# File 'lib/vitals/reporters/inmem_reporter.rb', line 6

def initialize
  flush
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



4
5
6
# File 'lib/vitals/reporters/inmem_reporter.rb', line 4

def format
  @format
end

#reportsObject

Returns the value of attribute reports.



3
4
5
# File 'lib/vitals/reporters/inmem_reporter.rb', line 3

def reports
  @reports
end

Instance Method Details

#flushObject



10
11
12
# File 'lib/vitals/reporters/inmem_reporter.rb', line 10

def flush
  @reports = []
end

#gauge(m, v) ⇒ Object



18
19
20
# File 'lib/vitals/reporters/inmem_reporter.rb', line 18

def gauge(m, v)
  @reports << { :gauge => n( m ), :val => v }
end

#inc(m) ⇒ Object



14
15
16
# File 'lib/vitals/reporters/inmem_reporter.rb', line 14

def inc(m)
  @reports << { :inc => n( m ) }
end

#timing(m, v) ⇒ Object



22
23
24
# File 'lib/vitals/reporters/inmem_reporter.rb', line 22

def timing(m, v)
  @reports << { :timing => n( m ), :val => v }
end