Trait rustis::commands::TDigestCommands
source · pub trait TDigestCommands<'a> {
Show 14 methods
// Provided methods
fn tdigest_add(
self,
key: impl SingleArg,
values: impl SingleArgCollection<f64>
) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn tdigest_byrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_byrevrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_cdf<V: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_create(
self,
key: impl SingleArg,
compression: Option<i64>
) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn tdigest_info(
self,
key: impl SingleArg
) -> PreparedCommand<'a, Self, TDigestInfoResult>
where Self: Sized { ... }
fn tdigest_max(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>
where Self: Sized { ... }
fn tdigest_merge<S: SingleArg>(
self,
destination: impl SingleArg,
sources: impl SingleArgCollection<S>,
options: TDigestMergeOptions
) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn tdigest_min(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>
where Self: Sized { ... }
fn tdigest_quantile<Q: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
quantiles: impl SingleArgCollection<Q>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_rank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_reset(self, key: impl SingleArg) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn tdigest_revrank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>
where Self: Sized { ... }
fn tdigest_trimmed_mean(
self,
key: impl SingleArg,
low_cut_quantile: f64,
high_cut_quantile: f64
) -> PreparedCommand<'a, Self, f64>
where Self: Sized { ... }
}redis-bloom only.Expand description
Provided Methods§
sourcefn tdigest_add(
self,
key: impl SingleArg,
values: impl SingleArgCollection<f64>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn tdigest_add(
self,
key: impl SingleArg,
values: impl SingleArgCollection<f64>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
sourcefn tdigest_byrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_byrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input rank, an estimation of the value (floating-point) with that rank.
Multiple estimations can be retrieved in a single call.
Arguments
key- key name for an existing t-digest sketch.ranks- collection of ranks, for which the value should be retrieved.0- is the rank of the value of the smallest observation.n-1- is the rank of the value of the largest observation;ndenotes the number of observations added to the sketch.
Return
a collection of floating-points populated with value_1, value_2, …, value_R:
- Return an accurate result when rank is
0(the value of the smallest observation) - Return an accurate result when rank is
n-1(the value of the largest observation),
where n denotes the number of observations added to the sketch. - Return
infwhen rank is equal to n or larger thann
See Also
sourcefn tdigest_byrevrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_byrevrank<R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
ranks: impl SingleArgCollection<usize>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input reverse rank, an estimation of the value (floating-point) with that reverse rank.
Multiple estimations can be retrieved in a single call.
Arguments
key- key name for an existing t-digest sketch.ranks- collection of reverse ranks, for which the value should be retrieved.0- is the reverse rank of the value of the largest observation.n-1- s the reverse rank of the value of the smallest observation; n denotes the number of observations added to the sketch.
Return
a collection of floating-points populated with value_1, value_2, …, value_R:
- Return an accurate result when
revrankis0(the value of the largest observation) - Return an accurate result when
revrankisn-1(the value of the smallest observation),
wherendenotes the number of observations added to the sketch. - Return ‘inf’ when
revrankis equal tonor larger thann
See Also
sourcefn tdigest_cdf<V: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_cdf<V: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input reverse rank, an estimation of the value (floating-point) with that reverse rank.
Multiple estimations can be retrieved in a single call.
Arguments
key- key name for an existing t-digest sketch.values- collection values for which the CDF
(Cumulative Distribution Function) should be retrieved.
Return
a collection of floating-points populated with fraction_1, fraction_2, …, fraction_N.
All values are nan if the sketch is empty.
See Also
sourcefn tdigest_create(
self,
key: impl SingleArg,
compression: Option<i64>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn tdigest_create(
self,
key: impl SingleArg,
compression: Option<i64>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
Allocates memory and initializes a new t-digest sketch.
Arguments
key- key name for this new t-digest sketch.compression- controllable tradeoff between accuracy and memory consumption.
100 is a common value for normal uses. 1000 is more accurate.
If no value is passed by default the compression will be 100.
For more information on scaling of accuracy versus the compression parameter,
seeThe t-digest: Efficient estimates of distributions.
See Also
sourcefn tdigest_info(
self,
key: impl SingleArg
) -> PreparedCommand<'a, Self, TDigestInfoResult>where
Self: Sized,
fn tdigest_info(
self,
key: impl SingleArg
) -> PreparedCommand<'a, Self, TDigestInfoResult>where
Self: Sized,
Returns information and statistics about a t-digest sketch
Arguments
key- key name for an existing t-digest sketch.
Return
An instance of TDigestInfoResult
See Also
sourcefn tdigest_max(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
fn tdigest_max(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
sourcefn tdigest_merge<S: SingleArg>(
self,
destination: impl SingleArg,
sources: impl SingleArgCollection<S>,
options: TDigestMergeOptions
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn tdigest_merge<S: SingleArg>(
self,
destination: impl SingleArg,
sources: impl SingleArgCollection<S>,
options: TDigestMergeOptions
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
Merges multiple t-digest sketches into a single sketch.
Arguments
destination- key name for a t-digest sketch to merge observation values to.- If
destinationnot exist, a new sketch is created. - If
destinationis an existing sketch, its values are merged with the values of the source keys.
To override the destination key contents useoverride.
- If
sources- collection of key names for t-digest sketches to merge observation values from.
See Also
sourcefn tdigest_min(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
fn tdigest_min(self, key: impl SingleArg) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
sourcefn tdigest_quantile<Q: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
quantiles: impl SingleArgCollection<Q>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_quantile<Q: SingleArg, R: CollectionResponse<f64>>(
self,
key: impl SingleArg,
quantiles: impl SingleArgCollection<Q>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input fraction, an estimation of the value (floating point) that is smaller than the given fraction of observations.
Multiple quantiles can be retrieved in a signle call.
Arguments
key- key name for an existing t-digest sketch.quantiles- collection of quantiles which are input fractions (between 0 and 1 inclusively)
Return
a collection of estimates (floating-point) populated with value_1, value_2, …, value_N.
- Return an accurate result when quantile is 0 (the value of the smallest observation)
- Return an accurate result when quantile is 1 (the value of the largest observation)
All values are nan if the sketch is empty.
See Also
sourcefn tdigest_rank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_rank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input value (floating-point), the estimated rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value).
Multiple ranks can be retrieved in a signle call.
Arguments
key- key name for an existing t-digest sketch.values- collection of values for which the rank should be estimated.
Return
a collection of integers populated with rank_1, rank_2, …, rank_V:
-1- whenvalueis smaller than the value of the smallest observation.- The number of observations - when
valueis larger than the value of the largest observation. - Otherwise: an estimation of the number of (observations smaller than
value+ half the observations equal tovalue).
0 is the rank of the value of the smallest observation.
n-1 is the rank of the value of the largest observation; n denotes the number of observations added to the sketch.
All values are -2 if the sketch is empty.
See Also
sourcefn tdigest_reset(self, key: impl SingleArg) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn tdigest_reset(self, key: impl SingleArg) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
sourcefn tdigest_revrank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
fn tdigest_revrank<V: SingleArg, R: CollectionResponse<isize>>(
self,
key: impl SingleArg,
values: impl SingleArgCollection<V>
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
Returns, for each input value (floating-point), the estimated reverse rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value).
Multiple reverse ranks can be retrieved in a signle call.
Arguments
key- key name for an existing t-digest sketch.values- collection of values for which the reverse rank should be estimated.
Return
a collection of integers populated with revrank_1, revrank_2, …, revrank_V:
-1- whenvalueis smaller than the value of the smallest observation.- The number of observations - when
valueis larger than the value of the largest observation. - Otherwise: an estimation of the number of (observations smaller than
value+ half the observations equal tovalue).
0 is the reverse rank of the value of the smallest observation.
n-1 is the reverse rank of the value of the largest observation; n denotes the number of observations added to the sketch.
All values are -2 if the sketch is empty.
See Also
sourcefn tdigest_trimmed_mean(
self,
key: impl SingleArg,
low_cut_quantile: f64,
high_cut_quantile: f64
) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
fn tdigest_trimmed_mean(
self,
key: impl SingleArg,
low_cut_quantile: f64,
high_cut_quantile: f64
) -> PreparedCommand<'a, Self, f64>where
Self: Sized,
Returns an estimation of the mean value from the sketch, excluding observation values outside the low and high cutoff quantiles.
Arguments
key- key name for an existing t-digest sketch.low_cut_quantile- Foating-point value in the range [0..1], should be lower thanhigh_cut_quantile
When equal to 0: No low cut.
When higher than 0: Exclude observation values lower than this quantile.high_cut_quantile- Floating-point value in the range [0..1], should be higher thanlow_cut_quantile
When lower than 1: Exclude observation values higher than or equal to this quantile.
When equal to 1: No high cut.
Return
estimation of the mean value. ‘nan’ if the sketch is empty.