Class: Pgbus::Metrics::Backend
- Inherits:
-
Object
- Object
- Pgbus::Metrics::Backend
- Defined in:
- lib/pgbus/metrics/backend.rb
Overview
Interface every metrics backend implements. The Subscriber only ever calls
these three methods, so a backend that satisfies them plugs in directly as
config.metrics_backend.
increment(name, value = 1, tags = {}) — monotonic counter add
gauge(name, value, tags = {}) — point-in-time value
histogram(name, value, tags = {}) — timing/size distribution sample
name is a pgbus_-prefixed String; tags is a Hash of low-cardinality
label => value pairs (no msg_id, no event_id).
Direct Known Subclasses
Pgbus::Metrics::Backends::Prometheus, Pgbus::Metrics::Backends::Statsd
Defined Under Namespace
Classes: Null
Instance Method Summary collapse
- #gauge(_name, _value, _tags = {}) ⇒ Object
- #histogram(_name, _value, _tags = {}) ⇒ Object
- #increment(_name, _value = 1, _tags = {}) ⇒ Object
Instance Method Details
#gauge(_name, _value, _tags = {}) ⇒ Object
20 21 22 |
# File 'lib/pgbus/metrics/backend.rb', line 20 def gauge(_name, _value, = {}) raise NotImplementedError, "#{self.class}#gauge" end |
#histogram(_name, _value, _tags = {}) ⇒ Object
24 25 26 |
# File 'lib/pgbus/metrics/backend.rb', line 24 def histogram(_name, _value, = {}) raise NotImplementedError, "#{self.class}#histogram" end |
#increment(_name, _value = 1, _tags = {}) ⇒ Object
16 17 18 |
# File 'lib/pgbus/metrics/backend.rb', line 16 def increment(_name, _value = 1, = {}) raise NotImplementedError, "#{self.class}#increment" end |