Package codes.grow.packages.loki
Record Class QueryResult
java.lang.Object
java.lang.Record
codes.grow.packages.loki.QueryResult
- Record Components:
resultType- result type reported by Lokistreams- log streams (streamsresults)vector- samples (vectorresults)matrix- series (matrixresults)scalar- value (scalarresults)stats- raw query statistics (data.stats), empty when absent
public record QueryResult(ResultType resultType, List<StreamResult> streams, List<VectorSample> vector, List<MatrixSeries> matrix, Optional<Sample> scalar, Map<String,Object> stats)
extends Record
Result of
LokiClient.query(java.lang.String), LokiClient.queryRange(java.lang.String), LokiClient.volume(java.lang.String) and
LokiClient.volumeRange(java.lang.String). Only the list matching resultType() is filled.-
Constructor Summary
ConstructorsConstructorDescriptionQueryResult(ResultType resultType, List<StreamResult> streams, List<VectorSample> vector, List<MatrixSeries> matrix, Optional<Sample> scalar, Map<String, Object> stats) Copies the fields. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.matrix()Returns the value of thematrixrecord component.Returns the value of theresultTyperecord component.scalar()Returns the value of thescalarrecord component.stats()Returns the value of thestatsrecord component.streams()Returns the value of thestreamsrecord component.final StringtoString()Returns a string representation of this record class.vector()Returns the value of thevectorrecord component.
-
Constructor Details
-
QueryResult
public QueryResult(ResultType resultType, List<StreamResult> streams, List<VectorSample> vector, List<MatrixSeries> matrix, Optional<Sample> scalar, Map<String, Object> stats) Copies the fields.- Parameters:
resultType- typestreams- streamsvector- vectormatrix- matrixscalar- scalarstats- statistics
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
resultType
Returns the value of theresultTyperecord component.- Returns:
- the value of the
resultTyperecord component
-
streams
Returns the value of thestreamsrecord component.- Returns:
- the value of the
streamsrecord component
-
vector
Returns the value of thevectorrecord component.- Returns:
- the value of the
vectorrecord component
-
matrix
Returns the value of thematrixrecord component.- Returns:
- the value of the
matrixrecord component
-
scalar
Returns the value of thescalarrecord component.- Returns:
- the value of the
scalarrecord component
-
stats
Returns the value of thestatsrecord component.- Returns:
- the value of the
statsrecord component
-