Class CounterSnapshot.CounterDataPointSnapshot
Object
DataPointSnapshot
CounterDataPointSnapshot
- Enclosing class:
- CounterSnapshot
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCounterDataPointSnapshot
(double value, Labels labels, Exemplar exemplar, long createdTimestampMillis) To create a newCounterSnapshot.CounterDataPointSnapshot
, you can either call the constructor directly or use the Builder withbuilder()
.CounterDataPointSnapshot
(double value, Labels labels, Exemplar exemplar, long createdTimestampMillis, long scrapeTimestampMillis) Constructor with an additional scrape timestamp. -
Method Summary
Methods inherited from class DataPointSnapshot
getCreatedTimestampMillis, getLabels, getScrapeTimestampMillis, hasCreatedTimestamp, hasScrapeTimestamp
-
Constructor Details
-
CounterDataPointSnapshot
public CounterDataPointSnapshot(double value, Labels labels, Exemplar exemplar, long createdTimestampMillis) To create a newCounterSnapshot.CounterDataPointSnapshot
, you can either call the constructor directly or use the Builder withbuilder()
.- Parameters:
value
- the counter value. Must not be negative.labels
- must not be null. UseLabels.EMPTY
if there are no labels.exemplar
- may be null.createdTimestampMillis
- timestamp (as inSystem.currentTimeMillis()
) when the time series (this specific set of labels) was created (or reset to zero). It's optional. Use0L
if there is no created timestamp.
-
CounterDataPointSnapshot
public CounterDataPointSnapshot(double value, Labels labels, Exemplar exemplar, long createdTimestampMillis, long scrapeTimestampMillis) Constructor with an additional scrape timestamp. This is only useful in rare cases as the scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include mirroring metrics with given timestamps from other metric sources.
-
-
Method Details
-
getValue
-
getExemplar
May benull
. -
builder
-