Module io.prometheus.metrics.model
Class StateSetSnapshot.StateSetDataPointSnapshot
java.lang.Object
io.prometheus.metrics.model.snapshots.DataPointSnapshot
io.prometheus.metrics.model.snapshots.StateSetSnapshot.StateSetDataPointSnapshot
- All Implemented Interfaces:
Iterable<StateSetSnapshot.State>
- Enclosing class:
StateSetSnapshot
public static class StateSetSnapshot.StateSetDataPointSnapshot
extends DataPointSnapshot
implements Iterable<StateSetSnapshot.State>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionStateSetDataPointSnapshot(String[] names, boolean[] values, Labels labels) To create a newStateSetSnapshot.StateSetDataPointSnapshot, you can either call the constructor directly or use the Builder withbuilder().StateSetDataPointSnapshot(String[] names, boolean[] values, Labels labels, long scrapeTimestampMillis) Constructor with an additional scrape timestamp. -
Method Summary
Methods inherited from class io.prometheus.metrics.model.snapshots.DataPointSnapshot
getCreatedTimestampMillis, getLabels, getScrapeTimestampMillis, hasCreatedTimestamp, hasScrapeTimestampMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StateSetDataPointSnapshot
To create a newStateSetSnapshot.StateSetDataPointSnapshot, you can either call the constructor directly or use the Builder withbuilder().- Parameters:
names- state names. Must have at least 1 entry. The constructor will create a copy of the array.values- state values. Must have the same length asnames. The constructor will create a copy of the array.labels- must not be null. UseLabels.EMPTYif there are no labels.
-
StateSetDataPointSnapshot
public StateSetDataPointSnapshot(String[] names, boolean[] values, Labels labels, 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
-
size
public int size() -
getName
-
isTrue
public boolean isTrue(int i) -
iterator
- Specified by:
iteratorin interfaceIterable<StateSetSnapshot.State>
-
stream
-
builder
-