Class: Nanoc::Telemetry::Registry
- Inherits:
-
Object
- Object
- Nanoc::Telemetry::Registry
- Defined in:
- lib/nanoc/telemetry/registry.rb
Instance Method Summary collapse
-
#counter(name) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
-
#summary(name) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry
5 6 7 8 |
# File 'lib/nanoc/telemetry/registry.rb', line 5 def initialize @counters = {} @summaries = {} end |
Instance Method Details
#counter(name) ⇒ Object
10 11 12 |
# File 'lib/nanoc/telemetry/registry.rb', line 10 def counter(name) @counters.fetch(name) { @counters[name] = LabelledCounter.new } end |
#summary(name) ⇒ Object
14 15 16 |
# File 'lib/nanoc/telemetry/registry.rb', line 14 def summary(name) @summaries.fetch(name) { @summaries[name] = LabelledSummary.new } end |