pub trait TDigestCommands {
Show 14 methods fn tdigest_add(
        &mut self,
        key: impl Into<CommandArg>,
        values: impl SingleArgOrCollection<f64>
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... } fn tdigest_byrank<R: FromSingleValueArray<f64>>(
        &mut self,
        key: impl Into<CommandArg>,
        ranks: impl SingleArgOrCollection<usize>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_byrevrank<R: FromSingleValueArray<f64>>(
        &mut self,
        key: impl Into<CommandArg>,
        ranks: impl SingleArgOrCollection<usize>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_cdf<V: Into<CommandArg>, R: FromSingleValueArray<f64>>(
        &mut self,
        key: impl Into<CommandArg>,
        values: impl SingleArgOrCollection<V>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_create(
        &mut self,
        key: impl Into<CommandArg>,
        compression: Option<i64>
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... } fn tdigest_info(
        &mut self,
        key: impl Into<CommandArg>
    ) -> PreparedCommand<'_, Self, TDigestInfoResult>
    where
        Self: Sized
, { ... } fn tdigest_max(
        &mut self,
        key: impl Into<CommandArg>
    ) -> PreparedCommand<'_, Self, f64>
    where
        Self: Sized
, { ... } fn tdigest_merge<S: Into<CommandArg>>(
        &mut self,
        destination: impl Into<CommandArg>,
        sources: impl SingleArgOrCollection<S>,
        options: TDigestMergeOptions
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... } fn tdigest_min(
        &mut self,
        key: impl Into<CommandArg>
    ) -> PreparedCommand<'_, Self, f64>
    where
        Self: Sized
, { ... } fn tdigest_quantile<Q: Into<CommandArg>, R: FromSingleValueArray<f64>>(
        &mut self,
        key: impl Into<CommandArg>,
        quantiles: impl SingleArgOrCollection<Q>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_rank<V: Into<CommandArg>, R: FromSingleValueArray<isize>>(
        &mut self,
        key: impl Into<CommandArg>,
        values: impl SingleArgOrCollection<V>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_reset(
        &mut self,
        key: impl Into<CommandArg>
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... } fn tdigest_revrank<V: Into<CommandArg>, R: FromSingleValueArray<isize>>(
        &mut self,
        key: impl Into<CommandArg>,
        values: impl SingleArgOrCollection<V>
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized
, { ... } fn tdigest_trimmed_mean(
        &mut self,
        key: impl Into<CommandArg>,
        low_cut_quantile: f64,
        high_cut_quantile: f64
    ) -> PreparedCommand<'_, Self, f64>
    where
        Self: Sized
, { ... }
}
Available on crate feature redis-bloom only.
Expand description

A group of Redis commands related to T-Digest

See Also

T-Digest Commands

Provided Methods§

Adds one or more observations to a t-digest sketch.

Arguments
  • key - key name for an existing t-digest sketch.
  • values - collection values of an observation (floating-point).
See Also

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; 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 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 inf when rank is equal to n or larger than n
See Also

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 revrank is 0 (the value of the largest observation)
  • Return an accurate result when revrank is n-1 (the value of the smallest observation),
    where n denotes the number of observations added to the sketch.
  • Return ‘inf’ when revrank is equal to n or larger than n
See Also

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

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,
    see The t-digest: Efficient estimates of distributions.
See Also

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

Returns the maximum observation value from a t-digest sketch.

Arguments
  • key - key name for an existing t-digest sketch.
Return

maximum observation value from a sketch. The result is always accurate. nan if the sketch is empty.

See Also

Merges multiple t-digest sketches into a single sketch.

Arguments
  • destination - key name for a t-digest sketch to merge observation values to.
    • If destination not exist, a new sketch is created.
    • If destination is an existing sketch, its values are merged with the values of the source keys.
      To override the destination key contents use override.
  • sources - collection of key names for t-digest sketches to merge observation values from.
See Also

Returns the minimum observation value from a t-digest sketch.

Arguments
  • key - key name for an existing t-digest sketch.
Return

minimum observation value from a sketch. The result is always accurate. nan if the sketch is empty.

See Also

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

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 - when value is smaller than the value of the smallest observation.
  • The number of observations - when value is larger than the value of the largest observation.
  • Otherwise: an estimation of the number of (observations smaller than value + half the observations equal to value).

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

Resets a t-digest sketch: empty the sketch and re-initializes it.

Arguments
  • key - key name for an existing t-digest sketch.
See Also

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 - when value is smaller than the value of the smallest observation.
  • The number of observations - when value is larger than the value of the largest observation.
  • Otherwise: an estimation of the number of (observations smaller than value + half the observations equal to value).

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

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 than high_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 than low_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.

See Also

Implementors§