Class: StatsdServer::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/statsdserver/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStats

Returns a new instance of Stats.



11
12
13
14
15
16
# File 'lib/statsdserver/stats.rb', line 11

def initialize
  @timers = Hash.new { |h, k| h[k] = Array.new }
  @counters = Hash.new { |h, k| h[k] = 0 }
  @gauges = Hash.new { |h, k| h[k] = 0 }
  @logger = Logger.new(STDERR)
end

Instance Attribute Details

#countersObject

Returns the value of attribute counters.



5
6
7
# File 'lib/statsdserver/stats.rb', line 5

def counters
  @counters
end

#gaugesObject

Returns the value of attribute gauges.



5
6
7
# File 'lib/statsdserver/stats.rb', line 5

def gauges
  @gauges
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/statsdserver/stats.rb', line 5

def logger
  @logger
end

#timersObject

Returns the value of attribute timers.



5
6
7
# File 'lib/statsdserver/stats.rb', line 5

def timers
  @timers
end