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
final class SdkLongGauge extends AbstractInstrument implements ExtendedLongGauge
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classSdkLongGauge.SdkLongGaugeBuilder
-
Field Summary
Fields Modifier and Type Field Description private SdkMetersdkMeterprivate WriteableMetricStoragestorage
-
Constructor Summary
Constructors Modifier Constructor Description privateSdkLongGauge(InstrumentDescriptor descriptor, SdkMeter sdkMeter, WriteableMetricStorage storage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEnabled()Returnstrueif 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 io.opentelemetry.sdk.metrics.AbstractInstrument
equals, getDescriptor, hashCode, toString
-
-
-
-
Field Detail
-
sdkMeter
private final SdkMeter sdkMeter
-
storage
private final WriteableMetricStorage storage
-
-
Constructor Detail
-
SdkLongGauge
private SdkLongGauge(InstrumentDescriptor descriptor, SdkMeter sdkMeter, WriteableMetricStorage storage)
-
-
Method Detail
-
set
public void set(long value, Attributes attributes)Description copied from interface:LongGaugeRecords a value with a set of attributes.
-
set
public void set(long value, Attributes attributes, Context context)Description copied from interface:LongGaugeRecords a value with a set of attributes.
-
set
public void set(long increment)
Description copied from interface:LongGaugeSet the gauge value.
-
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
-
-