TDIGEST.ADD

Syntax
TDIGEST.ADD key value weight [value weight ...]
Available in:
Redis Stack / Bloom 2.4.0
Time complexity:
O(N) , where N is the number of samples to add

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

Parameters:

  • key: The name of the sketch (a t-digest data structure)
  • val: The value of the observation (floating-point). The value should be a finite number
  • weight: The weight of this observation (positive integer).

Return

Simple string reply - OK if executed correctly, or Error reply otherwise.

Examples

redis> TDIGEST.ADD t-digest 42 1 194 1
OK
redis> TDIGEST.ADD t-digest string 1
(error) ERR T-Digest: error parsing val parameter
redis> TDIGEST.ADD t-digest 42 string
(error) ERR T-Digest: error parsing weight parameter

Feedback

If you've found issues on this page, or have suggestions for improvement, please submit a request to merge or open an issue in the repository.