Class: OpenTelemetry::Metrics::Instrument::UpDownCounter
- Inherits:
-
Object
- Object
- OpenTelemetry::Metrics::Instrument::UpDownCounter
- Defined in:
- lib/opentelemetry/metrics/instrument/up_down_counter.rb
Overview
No-op implementation of UpDownCounter.
Instance Method Summary collapse
-
#add(amount, attributes: {}) ⇒ Object
Increment or decrement the UpDownCounter by a fixed amount.
-
#bind(attributes: {}) ⇒ UpDownCounter
(Development) Binds a fixed set of attributes to this UpDownCounter, returning an instrument whose #add calls associate every measurement with those attributes.
-
#enabled? ⇒ Boolean
Returns whether this UpDownCounter is enabled for recording measurements.
Instance Method Details
#add(amount, attributes: {}) ⇒ Object
Increment or decrement the UpDownCounter by a fixed amount.
19 |
# File 'lib/opentelemetry/metrics/instrument/up_down_counter.rb', line 19 def add(amount, attributes: {}); end |
#bind(attributes: {}) ⇒ UpDownCounter
(Development) Binds a fixed set of attributes to this UpDownCounter, returning an instrument whose #add calls associate every measurement with those attributes. Attributes are resolved once at bind time rather than on every recording, avoiding repeated attribute processing and lookup. Passing attributes to #add on the returned bound instrument negates this benefit.
44 45 46 |
# File 'lib/opentelemetry/metrics/instrument/up_down_counter.rb', line 44 def bind(attributes: {}) self end |
#enabled? ⇒ Boolean
Returns whether this UpDownCounter is enabled for recording measurements.
Instrumentation authors need to call this API each time they record a measurement to ensure they have the most up-to-date value.
29 30 31 |
# File 'lib/opentelemetry/metrics/instrument/up_down_counter.rb', line 29 def enabled? true end |