Package codes.grow.packages.signoz
Record Class AggregateQuery
java.lang.Object
java.lang.Record
codes.grow.packages.signoz.AggregateQuery
- Record Components:
signal- logs or tracesfilter- SigNoz filter expression (""= all)aggregations- values to compute (at least one)groupBy- field names to group bystart- window start (null= one hour before the end)end- window end (null= now)stepInterval- bucket size of a time series (nullor zero = scalar, one row per group); rounded down to whole seconds (at least 1 s)limit- maximum number of groups (0 = default 100)orderKey- group field or aggregation alias to order groups by (null= server order)orderDirection- direction oforderKey(null= descending)
public record AggregateQuery(Signal signal, String filter, List<Aggregation> aggregations, List<String> groupBy, Instant start, Instant end, Duration stepInterval, int limit, String orderKey, SortOrder orderDirection)
extends Record
A count/percentile query for
SignozQueryClient.aggregate(AggregateQuery). Build it with
builder(Signal):
AggregateQuery q = AggregateQuery.builder(Signal.TRACES)
.filter("service.name = 'checkout'")
.count("calls")
.percentile(99, "duration_nano", "p99")
.groupBy("name")
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregationsrecord component.static AggregateBuilderStarts a builder over a signal.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.filter()Returns the value of thefilterrecord component.groupBy()Returns the value of thegroupByrecord component.final inthashCode()Returns a hash code value for this object.booleanWhether this is a time-series query.intlimit()Returns the value of thelimitrecord component.Returns the value of theorderDirectionrecord component.orderKey()Returns the value of theorderKeyrecord component.signal()Returns the value of thesignalrecord component.start()Returns the value of thestartrecord component.Window start.Returns the value of thestepIntervalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AggregateQuery
public AggregateQuery(Signal signal, String filter, List<Aggregation> aggregations, List<String> groupBy, Instant start, Instant end, Duration stepInterval, int limit, String orderKey, SortOrder orderDirection) Copies the lists and fillsnullvalues.- Parameters:
signal- signalfilter- filteraggregations- aggregationsgroupBy- group fieldsstart- startend- endstepInterval- steplimit- limitorderKey- order keyorderDirection- order direction
-
-
Method Details
-
builder
Starts a builder over a signal.- Parameters:
signal- logs or traces- Returns:
- a new builder (its
run()needs a client: useSignozQueryClient.aggregate(Signal)for that)
-
isTimeSeries
public boolean isTimeSeries()Whether this is a time-series query.- Returns:
- true when a positive step is set
-
startOptional
Window start.- Returns:
- the start, if set
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
signal
Returns the value of thesignalrecord component.- Returns:
- the value of the
signalrecord component
-
filter
Returns the value of thefilterrecord component.- Returns:
- the value of the
filterrecord component
-
aggregations
Returns the value of theaggregationsrecord component.- Returns:
- the value of the
aggregationsrecord component
-
groupBy
Returns the value of thegroupByrecord component.- Returns:
- the value of the
groupByrecord component
-
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
stepInterval
Returns the value of thestepIntervalrecord component.- Returns:
- the value of the
stepIntervalrecord component
-
limit
public int limit()Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-
orderKey
Returns the value of theorderKeyrecord component.- Returns:
- the value of the
orderKeyrecord component
-
orderDirection
Returns the value of theorderDirectionrecord component.- Returns:
- the value of the
orderDirectionrecord component
-