pub struct TsMRangeOptions { /* private fields */ }
Available on crate feature redis-time-series only.
Expand description

Options for the ts_mrange and ts_mrevrange commands.

Implementations§

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 [from_timestamp, to_timestamp]. Without latest, ts_mrange does not report the latest possibly partial bucket. When a time series is not a compaction, latest is ignored.

The data in the latest bucket of a compaction is possibly partial. A bucket is closed and compacted only upon arrival of a new sample that opens a new latest bucket. There are cases, however, when the compacted value of the latest possibly partial bucket is also required. In such a case, use latest.

filters samples by a list of specific timestamps.

A sample passes the filter if its exact timestamp is specified and falls within [from_timestamp, to_timestamp].

filters samples by minimum and maximum values.

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 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.

limits the number of returned samples.

A time bucket alignment control for aggregation.

It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined.

Values include:

  • start or -: The reference timestamp will be the query start interval time (from_timestamp) which can’t be -
  • end or +: The reference timestamp will be the query end interval time (to_timestamp) which can’t be +
  • A specific timestamp: align the reference timestamp to a specific time
Note

When not provided, alignment is set to 0.

Aggregates results into time buckets, where:

  • aggregator - takes a value of TsAggregationType
  • bucket_duration - is duration of each bucket, in milliseconds.

Without align, bucket start times are multiples of bucket_duration.

With align, bucket start times are multiples of bucket_duration with remainder align % bucket_duration.

The first bucket start time is less than or equal to from_timestamp.

controls how bucket timestamps are reported. bucket_timestamp values include:

  • - or low - Timestamp reported for each bucket is the bucket’s start time (default)
  • + or high - Timestamp reported for each bucket is the bucket’s end time
  • ~ or mid - Timestamp reported for each bucket is the bucket’s mid time (rounded down if not an integer)

A flag, which, when specified, reports aggregations also for empty buckets. when aggregator values are:

  • sum, count - the value reported for each empty bucket is 0
  • last - the value reported for each empty bucket is the value of the last sample before the bucket’s start. NaN when no such sample.
  • twa - the value reported for each empty bucket is the average value over the bucket’s timeframe based on linear interpolation of the last sample before the bucket’s start and the first sample after the bucket’s end. NaN when no such samples.
  • min, max, range, avg, first, std.p, std.s - the value reported for each empty bucket is NaN

Regardless of the values of from_timestamp and to_timestamp, no data is reported for buckets that end before the earliest sample or begin after the latest sample in the time series.

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more