Trait fred::interfaces::TimeSeriesInterface

source ·
pub trait TimeSeriesInterface: ClientLike {
Show 17 methods // Provided methods fn ts_add<R, K, T, L>( &self, key: K, timestamp: T, value: f64, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, on_duplicate: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, T: TryInto<Timestamp>, T::Error: Into<RedisError>, L: TryInto<RedisMap>, L::Error: Into<RedisError> { ... } fn ts_alter<R, K, L>( &self, key: K, retention: Option<u64>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, L: TryInto<RedisMap>, L::Error: Into<RedisError> { ... } fn ts_create<R, K, L>( &self, key: K, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, L: TryInto<RedisMap>, L::Error: Into<RedisError> { ... } fn ts_createrule<R, S, D>( &self, src: S, dest: D, aggregation: (Aggregator, u64), align_timestamp: Option<u64>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn ts_decrby<R, K, L>( &self, key: K, subtrahend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, L: TryInto<RedisMap>, L::Error: Into<RedisError> { ... } fn ts_del<R, K>( &self, key: K, from: i64, to: i64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn ts_deleterule<R, S, D>( &self, src: S, dest: D, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn ts_get<R, K>( &self, key: K, latest: bool, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn ts_incrby<R, K, L>( &self, key: K, addend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, L: TryInto<RedisMap>, L::Error: Into<RedisError> { ... } fn ts_info<R, K>( &self, key: K, debug: bool, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn ts_madd<R, K, I>( &self, samples: I, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, I: IntoIterator<Item = (K, Timestamp, f64)> { ... } fn ts_mget<R, L, S, I>( &self, latest: bool, labels: Option<L>, filters: I, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, L: Into<GetLabels>, S: Into<Str>, I: IntoIterator<Item = S> { ... } fn ts_mrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S> { ... } fn ts_mrevrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S> { ... } fn ts_queryindex<R, S, I>( &self, filters: I, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<Str>, I: IntoIterator<Item = S> { ... } fn ts_range<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, I: IntoIterator<Item = i64> { ... } fn ts_revrange<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, I: IntoIterator<Item = i64> { ... }
}
Available on crate feature i-time-series only.
Expand description

A Redis Timeseries interface.

Provided Methods§

source

fn ts_add<R, K, T, L>( &self, key: K, timestamp: T, value: f64, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, on_duplicate: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Append a sample to a time series.

https://redis.io/commands/ts.add/

source

fn ts_alter<R, K, L>( &self, key: K, retention: Option<u64>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Update the retention, chunk size, duplicate policy, and labels of an existing time series.

https://redis.io/commands/ts.alter/

source

fn ts_create<R, K, L>( &self, key: K, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Create a new time series.

https://redis.io/commands/ts.create/

source

fn ts_createrule<R, S, D>( &self, src: S, dest: D, aggregation: (Aggregator, u64), align_timestamp: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Create a compaction rule.

https://redis.io/commands/ts.createrule/

source

fn ts_decrby<R, K, L>( &self, key: K, subtrahend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement.

https://redis.io/commands/ts.decrby/

source

fn ts_del<R, K>( &self, key: K, from: i64, to: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Delete all samples between two timestamps for a given time series.

https://redis.io/commands/ts.del/

source

fn ts_deleterule<R, S, D>( &self, src: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Delete a compaction rule.

https://redis.io/commands/ts.deleterule/

source

fn ts_get<R, K>( &self, key: K, latest: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Get the sample with the highest timestamp from a given time series.

https://redis.io/commands/ts.get/

source

fn ts_incrby<R, K, L>( &self, key: K, addend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment.

https://redis.io/commands/ts.incrby/

source

fn ts_info<R, K>( &self, key: K, debug: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Return information and statistics for a time series.

https://redis.io/commands/ts.info/

source

fn ts_madd<R, K, I>(&self, samples: I) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, I: IntoIterator<Item = (K, Timestamp, f64)>,

Append new samples to one or more time series.

https://redis.io/commands/ts.madd/

source

fn ts_mget<R, L, S, I>( &self, latest: bool, labels: Option<L>, filters: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, L: Into<GetLabels>, S: Into<Str>, I: IntoIterator<Item = S>,

Get the sample with the highest timestamp from each time series matching a specific filter.

See Resp2TimeSeriesValues and Resp3TimeSeriesValues for more information.

https://redis.io/commands/ts.mget/

source

fn ts_mrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S>,

Query a range across multiple time series by filters in the forward direction.

See Resp2TimeSeriesValues and Resp3TimeSeriesValues for more information.

https://redis.io/commands/ts.mrange/

source

fn ts_mrevrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S>,

Query a range across multiple time series by filters in the reverse direction.

See Resp2TimeSeriesValues and Resp3TimeSeriesValues for more information.

https://redis.io/commands/ts.mrevrange/

source

fn ts_queryindex<R, S, I>( &self, filters: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>, I: IntoIterator<Item = S>,

Get all time series keys matching a filter list.

https://redis.io/commands/ts.queryindex/

source

fn ts_range<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>>

Query a range in forward direction.

https://redis.io/commands/ts.range/

source

fn ts_revrange<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>>

Query a range in reverse direction.

https://redis.io/commands/ts.revrange/

Object Safety§

This trait is not object safe.

Implementors§