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 -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionStateSetDataPointSnapshot(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.privateStateSetDataPointSnapshot(String[] names, boolean[] values, Labels labels, long scrapeTimestampMillis, boolean internal) -
Method Summary
Modifier and TypeMethodDescriptionprivate List<StateSetSnapshot.State>asList()builder()(package private) DataPointSnapshotescape(EscapingScheme escapingScheme) getName(int i) booleanisTrue(int i) iterator()intsize()private static voidstream()private static voidprivate voidvalidate()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
-
Field Details
-
names
-
values
final boolean[] values
-
-
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. -
StateSetDataPointSnapshot
-
-
Method Details
-
size
public int size() -
getName
-
isTrue
public boolean isTrue(int i) -
validate
private void validate() -
escape
- Specified by:
escapein classDataPointSnapshot
-
asList
-
iterator
- Specified by:
iteratorin interfaceIterable<StateSetSnapshot.State>
-
stream
-
sort
-
swap
-
builder
-