Class: Roqua::Support::Stats
- Inherits:
-
Object
- Object
- Roqua::Support::Stats
- 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
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
Instance Method Summary collapse
-
#initialize(backend = NullBackend.instance) ⇒ Stats
constructor
A new instance of Stats.
-
#submit(key, value) ⇒ Object
Report a value to the stats backend.
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
#backend ⇒ Object (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 |