Package io.opentelemetry.sdk.metrics
Class SdkLongGauge
java.lang.Object
io.opentelemetry.sdk.metrics.AbstractInstrument
io.opentelemetry.sdk.metrics.SdkLongGauge
- All Implemented Interfaces:
ExtendedLongGauge
,LongGauge
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
SdkLongGauge
(InstrumentDescriptor descriptor, SdkMeter sdkMeter, WriteableMetricStorage storage) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the gauge is enabled.void
set
(long increment) Set the gauge value.void
set
(long value, Attributes attributes) Records a value with a set of attributes.void
set
(long value, Attributes attributes, Context context) Records a value with a set of attributes.Methods inherited from class io.opentelemetry.sdk.metrics.AbstractInstrument
equals, getDescriptor, hashCode, toString
-
Field Details
-
sdkMeter
-
storage
-
-
Constructor Details
-
SdkLongGauge
private SdkLongGauge(InstrumentDescriptor descriptor, SdkMeter sdkMeter, WriteableMetricStorage storage)
-
-
Method Details
-
set
Description copied from interface:LongGauge
Records a value with a set of attributes. -
set
Description copied from interface:LongGauge
Records a value with a set of attributes. -
set
public void set(long increment) Description copied from interface:LongGauge
Set the gauge value. -
isEnabled
public boolean isEnabled()Description copied from interface:ExtendedLongGauge
Returnstrue
if the gauge is enabled.This allows callers to avoid unnecessary compute when nothing is consuming the data. Because the response is subject to change over the application, callers should call this before each call to
LongGauge.set(long)
,LongGauge.set(long, Attributes)
, orLongGauge.set(long, Attributes, Context)
.- Specified by:
isEnabled
in interfaceExtendedLongGauge
-