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
ConstructorsModifierConstructorDescriptionprivateSdkLongGauge(InstrumentDescriptor descriptor, SdkMeter sdkMeter, WriteableMetricStorage storage) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the gauge is enabled.voidset(long increment) Set the gauge value.voidset(long value, Attributes attributes) Records a value with a set of attributes.voidset(long value, Attributes attributes, Context context) Records a value with a set of attributes.Methods inherited from class 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:LongGaugeRecords a value with a set of attributes. -
set
Description copied from interface:LongGaugeRecords a value with a set of attributes. -
set
-
isEnabled
public boolean isEnabled()Description copied from interface:ExtendedLongGaugeReturnstrueif 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:
isEnabledin interfaceExtendedLongGauge
-