Class MRangeArgs
- java.lang.Object
-
- io.quarkus.redis.datasource.timeseries.MRangeArgs
-
- All Implemented Interfaces:
RedisCommandExtraArguments
public class MRangeArgs extends Object implements RedisCommandExtraArguments
Represent theTS.MRANGE
andTS.MREVRANGE
commands optional parameters.
-
-
Constructor Summary
Constructors Constructor Description MRangeArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MRangeArgs
aggregation(Aggregation aggregation, Duration bucketDuration)
Aggregates results into time buckets.MRangeArgs
align(long timestamp)
Set the time bucket alignment control for AGGREGATION.MRangeArgs
alignUsingRangeEnd()
Set the time bucket alignment control for AGGREGATION to the query end interval time (toTimestamp).MRangeArgs
alignUsingRangeStart()
Set the time bucket alignment control for AGGREGATION to the query start interval time (fromTimestamp).MRangeArgs
bucketTimestamp(BucketTimestamp ts)
Controls how bucket timestamps are reported.MRangeArgs
count(int count)
Limits the number of returned samples.MRangeArgs
empty()
When specified, reports aggregations also for empty buckets.MRangeArgs
filterByTimestamp(long... timestamps)
Filters samples by a list of specific timestamps.MRangeArgs
filterByValue(double min, double max)
Filters samples by minimum and maximum values.List<String>
getGroupByClauseArgs()
MRangeArgs
groupBy(String label, Reducer reducer)
Aggregates results across different time series, grouped by the provided label name.MRangeArgs
latest()
Used when a time series is a compaction.MRangeArgs
selectedLabels(String... labels)
Returns a subset of the label-value pairs that represent metadata labels of the time series.List<String>
toArgs()
MRangeArgs
withLabels()
Includes in the reply all label-value pairs representing metadata labels of the time series.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommandExtraArguments
toArgs
-
-
-
-
Method Detail
-
latest
public MRangeArgs latest()
Used when a time series is a compaction. With LATEST, TS.MRANGE also reports the compacted value of the latest possibly partial bucket, given that this bucket's start time falls within [fromTimestamp, toTimestamp]. Without LATEST, TS.MRANGE does not report the latest possibly partial bucket. When a time series is not a compaction, LATEST is ignored.- Returns:
- the current
MRangeArgs
-
filterByTimestamp
public MRangeArgs filterByTimestamp(long... timestamps)
Filters samples by a list of specific timestamps. A sample passes the filter if its exact timestamp is specified and falls within [fromTimestamp, toTimestamp].- Parameters:
timestamps
- the timestamps- Returns:
- the current
MRangeArgs
-
filterByValue
public MRangeArgs filterByValue(double min, double max)
Filters samples by minimum and maximum values.- Parameters:
min
- the min value of the samplemax
- the max value of the sample- Returns:
- the current
MRangeArgs
-
withLabels
public MRangeArgs withLabels()
Includes in the reply all label-value pairs representing metadata labels of the time series. If WITHLABELS or SELECTED_LABELS are not specified, by default, an empty list is reported as label-value pairs.- Returns:
- the current
MRangeArgs
-
selectedLabels
public MRangeArgs selectedLabels(String... labels)
Returns a subset of the label-value pairs that represent metadata labels of the time series. Use when a large number of labels exists per series, but only the values of some of the labels are required.If WITHLABELS or SELECTED_LABELS are not specified, by default, an empty list is reported as label-value pairs.
- Parameters:
labels
- the set of labels to select- Returns:
- the current
MRangeArgs
-
count
public MRangeArgs count(int count)
Limits the number of returned samples.- Parameters:
count
- the max number of samples to return- Returns:
- the current
MRangeArgs
-
align
public MRangeArgs align(long timestamp)
Set the time bucket alignment control for AGGREGATION. It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined.- Parameters:
timestamp
- the timestamp- Returns:
- the current
MRangeArgs
-
alignUsingRangeStart
public MRangeArgs alignUsingRangeStart()
Set the time bucket alignment control for AGGREGATION to the query start interval time (fromTimestamp). It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined.- Returns:
- the current
MRangeArgs
-
alignUsingRangeEnd
public MRangeArgs alignUsingRangeEnd()
Set the time bucket alignment control for AGGREGATION to the query end interval time (toTimestamp). It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined.- Returns:
- the current
MRangeArgs
-
aggregation
public MRangeArgs aggregation(Aggregation aggregation, Duration bucketDuration)
Aggregates results into time buckets.- Parameters:
aggregation
- the aggregation function, must not benull
bucketDuration
- the duration of each bucket, must not benull
- Returns:
- the current
MRangeArgs
-
bucketTimestamp
public MRangeArgs bucketTimestamp(BucketTimestamp ts)
Controls how bucket timestamps are reported.- Parameters:
ts
- the bucket timestamp configuration, must not benull
- Returns:
- the current
MRangeArgs
-
empty
public MRangeArgs empty()
When specified, reports aggregations also for empty buckets.- Returns:
- the current
MRangeArgs
-
groupBy
public MRangeArgs groupBy(String label, Reducer reducer)
Aggregates results across different time series, grouped by the provided label name. When combined with AGGREGATION the groupby/reduce is applied post aggregation stage.label
is label name to group a series by. A new series for each value is produced.reducer
is the reducer type used to aggregate series that share the same label value.- Parameters:
label
- the label, must not benull
reducer
- the reducer function, must not benull
- Returns:
- the current
MRangeArgs
-
toArgs
public List<String> toArgs()
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Returns:
- the list of arguments, encoded as a list of String.
-
-