Class MutableMeasurement
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.state.MutableMeasurement
-
- All Implemented Interfaces:
Measurement
public final class MutableMeasurement extends java.lang.Object implements Measurement
A mutableMeasurementimplementationThis class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
This class is not thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private Attributesattributesprivate doubledoubleValueprivate longepochNanosprivate booleanhasDoubleValueprivate booleanhasLongValueprivate longlongValueprivate longstartEpochNanos
-
Constructor Summary
Constructors Constructor Description MutableMeasurement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributesattributes()doubledoubleValue()longepochNanos()booleanhasDoubleValue()booleanhasLongValue()longlongValue()private voidset(long startEpochNanos, long epochNanos, boolean hasLongValue, long longValue, boolean hasDoubleValue, double doubleValue, Attributes attributes)Sets the values.(package private) static voidsetDoubleMeasurement(MutableMeasurement mutableMeasurement, long startEpochNanos, long epochNanos, double value, Attributes attributes)(package private) static voidsetLongMeasurement(MutableMeasurement mutableMeasurement, long startEpochNanos, long epochNanos, long value, Attributes attributes)longstartEpochNanos()MeasurementwithAttributes(Attributes attributes)Updates the attributes.MeasurementwithStartEpochNanos(long startEpochNanos)Updates the startEpochNanos.
-
-
-
Field Detail
-
startEpochNanos
private long startEpochNanos
-
epochNanos
private long epochNanos
-
hasLongValue
private boolean hasLongValue
-
longValue
private long longValue
-
hasDoubleValue
private boolean hasDoubleValue
-
doubleValue
private double doubleValue
-
attributes
private Attributes attributes
-
-
Method Detail
-
setDoubleMeasurement
static void setDoubleMeasurement(MutableMeasurement mutableMeasurement, long startEpochNanos, long epochNanos, double value, Attributes attributes)
-
setLongMeasurement
static void setLongMeasurement(MutableMeasurement mutableMeasurement, long startEpochNanos, long epochNanos, long value, Attributes attributes)
-
set
private void set(long startEpochNanos, long epochNanos, boolean hasLongValue, long longValue, boolean hasDoubleValue, double doubleValue, Attributes attributes)Sets the values.
-
withStartEpochNanos
public Measurement withStartEpochNanos(long startEpochNanos)
Description copied from interface:MeasurementUpdates the startEpochNanos.- Specified by:
withStartEpochNanosin interfaceMeasurement- Parameters:
startEpochNanos- start epoch nanosecond- Returns:
- The updated object. For
ImmutableMeasurementit will be a new object with the updated startEpochNanos and forMutableMeasurementit will return itself with the startEpochNanos updated
-
withAttributes
public Measurement withAttributes(Attributes attributes)
Description copied from interface:MeasurementUpdates the attributes.- Specified by:
withAttributesin interfaceMeasurement- Parameters:
attributes- The attributes to update- Returns:
- The updated object. For
ImmutableMeasurementit will be a new object with the updated attributes and forMutableMeasurementit will return itself with the attributes updated
-
startEpochNanos
public long startEpochNanos()
- Specified by:
startEpochNanosin interfaceMeasurement
-
epochNanos
public long epochNanos()
- Specified by:
epochNanosin interfaceMeasurement
-
hasLongValue
public boolean hasLongValue()
- Specified by:
hasLongValuein interfaceMeasurement
-
longValue
public long longValue()
- Specified by:
longValuein interfaceMeasurement
-
hasDoubleValue
public boolean hasDoubleValue()
- Specified by:
hasDoubleValuein interfaceMeasurement
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein interfaceMeasurement
-
attributes
public Attributes attributes()
- Specified by:
attributesin interfaceMeasurement
-
-