Class Counter.DataPoint
java.lang.Object
io.prometheus.metrics.core.metrics.Counter.DataPoint
- All Implemented Interfaces:
CounterDataPoint,DataPoint
- Enclosing class:
- Counter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final DoubleAdderprivate final ExemplarSamplerprivate final LongAdder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleget()Get the current value.longGet the current value as along.voidinc(double amount) Addamount.voidinc(long amount) Addamount.voidincWithExemplar(double amount, Labels labels) Addamount, and create a custom exemplar with the given labels.voidincWithExemplar(long amount, Labels labels) Addamount, and create a custom exemplar with the given labels.private voidvalidateAndAdd(double amount) private voidvalidateAndAdd(long amount) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.prometheus.metrics.core.datapoints.CounterDataPoint
inc, incWithExemplar
-
Field Details
-
doubleValue
-
longValue
-
createdTimeMillis
private final long createdTimeMillis -
exemplarSampler
-
-
Constructor Details
-
DataPoint
-
-
Method Details
-
get
public double get()Description copied from interface:CounterDataPointGet the current value.- Specified by:
getin interfaceCounterDataPoint
-
getLongValue
public long getLongValue()Description copied from interface:CounterDataPointGet the current value as along. Decimal places will be discarded.- Specified by:
getLongValuein interfaceCounterDataPoint
-
inc
public void inc(long amount) Description copied from interface:CounterDataPoint- Specified by:
incin interfaceCounterDataPoint
-
inc
public void inc(double amount) Description copied from interface:CounterDataPoint- Specified by:
incin interfaceCounterDataPoint
-
incWithExemplar
Description copied from interface:CounterDataPointAddamount, and create a custom exemplar with the given labels. Throws anIllegalArgumentExceptionifamountis negative.- Specified by:
incWithExemplarin interfaceCounterDataPoint
-
incWithExemplar
Description copied from interface:CounterDataPointAddamount, and create a custom exemplar with the given labels. Throws anIllegalArgumentExceptionifamountis negative.- Specified by:
incWithExemplarin interfaceCounterDataPoint
-
validateAndAdd
private void validateAndAdd(long amount) -
validateAndAdd
private void validateAndAdd(double amount) -
collect
-