Handles Redis-compatible TDIGEST.* commands.
A t-digest is a probabilistic data structure for accurate on-line accumulation of rank-based statistics such as quantiles, trimmed means, and cumulative distribution values. It provides high accuracy at the tails (P99, P99.9) while using bounded memory.
Storage format
T-digests are stored as tagged tuples via the injected store map:
{:tdigest, centroids_list, metadata}where centroids_list is a list of {mean, weight} tuples sorted by mean,
and metadata is a map containing compression, count, min, max, buffer, and
total_compressions.
Supported commands
TDIGEST.CREATE key [COMPRESSION compression]-- create a new t-digestTDIGEST.ADD key value [value ...]-- add observationsTDIGEST.RESET key-- clear data, preserve compressionTDIGEST.QUANTILE key quantile [quantile ...]-- estimate values at quantilesTDIGEST.CDF key value [value ...]-- estimate CDF at valuesTDIGEST.RANK key value [value ...]-- estimate rank of valuesTDIGEST.REVRANK key value [value ...]-- estimate reverse rankTDIGEST.BYRANK key rank [rank ...]-- estimate value at rankTDIGEST.BYREVRANK key rank [rank ...]-- estimate value at reverse rankTDIGEST.TRIMMED_MEAN key low_quantile high_quantile-- trimmed meanTDIGEST.MIN key-- minimum observed valueTDIGEST.MAX key-- maximum observed valueTDIGEST.INFO key-- digest metadataTDIGEST.MERGE destkey numkeys src [src ...] [COMPRESSION c] [OVERRIDE]
Summary
Functions
Handles a TDIGEST command.