Class: Roqua::Support::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/roqua/support/stats.rb,
lib/roqua/support/stats/hosted_graphite_backend.rb

Defined Under Namespace

Classes: HostedGraphiteBackend

Constant Summary collapse

NullBackend =
Naught.build do |config|
  config.singleton
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(backend = NullBackend.instance) ⇒ Stats

Returns a new instance of Stats.



12
13
14
# File 'lib/roqua/support/stats.rb', line 12

def initialize(backend = NullBackend.instance)
  @backend = backend
end

Instance Attribute Details

#backendObject (readonly)

Returns the value of attribute backend.



10
11
12
# File 'lib/roqua/support/stats.rb', line 10

def backend
  @backend
end

Instance Method Details

#submit(key, value) ⇒ Object

Report a value to the stats backend



17
18
19
# File 'lib/roqua/support/stats.rb', line 17

def submit(key, value)
  backend.submit(prefix(key), value)
end