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> { ... }
}i-time-series only.Expand description
A Redis Timeseries interface.
Provided Methods§
sourcefn 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>>
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.
sourcefn 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>>
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.
sourcefn 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>>
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.
sourcefn ts_createrule<R, S, D>(
&self,
src: S,
dest: D,
aggregation: (Aggregator, u64),
align_timestamp: Option<u64>,
) -> impl Future<Output = RedisResult<R>>
fn ts_createrule<R, S, D>( &self, src: S, dest: D, aggregation: (Aggregator, u64), align_timestamp: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
Create a compaction rule.
sourcefn 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>>
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.
sourcefn ts_del<R, K>(
&self,
key: K,
from: i64,
to: i64,
) -> impl Future<Output = RedisResult<R>>
fn ts_del<R, K>( &self, key: K, from: i64, to: i64, ) -> impl Future<Output = RedisResult<R>>
Delete all samples between two timestamps for a given time series.
sourcefn ts_deleterule<R, S, D>(
&self,
src: S,
dest: D,
) -> impl Future<Output = RedisResult<R>>
fn ts_deleterule<R, S, D>( &self, src: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
Delete a compaction rule.
sourcefn ts_get<R, K>(
&self,
key: K,
latest: bool,
) -> impl Future<Output = RedisResult<R>>
fn ts_get<R, K>( &self, key: K, latest: bool, ) -> impl Future<Output = RedisResult<R>>
Get the sample with the highest timestamp from a given time series.
sourcefn 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>>
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.
sourcefn ts_info<R, K>(
&self,
key: K,
debug: bool,
) -> impl Future<Output = RedisResult<R>>
fn ts_info<R, K>( &self, key: K, debug: bool, ) -> impl Future<Output = RedisResult<R>>
Return information and statistics for a time series.
sourcefn ts_madd<R, K, I>(&self, samples: I) -> impl Future<Output = RedisResult<R>>
fn ts_madd<R, K, I>(&self, samples: I) -> impl Future<Output = RedisResult<R>>
Append new samples to one or more time series.
sourcefn ts_mget<R, L, S, I>(
&self,
latest: bool,
labels: Option<L>,
filters: I,
) -> impl Future<Output = RedisResult<R>>
fn ts_mget<R, L, S, I>( &self, latest: bool, labels: Option<L>, filters: I, ) -> impl Future<Output = RedisResult<R>>
Get the sample with the highest timestamp from each time series matching a specific filter.
See Resp2TimeSeriesValues and Resp3TimeSeriesValues for more information.
sourcefn 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_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.
sourcefn 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_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.
sourcefn ts_queryindex<R, S, I>(
&self,
filters: I,
) -> impl Future<Output = RedisResult<R>>
fn ts_queryindex<R, S, I>( &self, filters: I, ) -> impl Future<Output = RedisResult<R>>
Get all time series keys matching a filter list.
sourcefn 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_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>,
Query a range in forward direction.
sourcefn 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>,
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>,
Query a range in reverse direction.