All Projects → usmanm → redis-tdigest

usmanm / redis-tdigest

Licence: MIT license
t-digest module for Redis

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to redis-tdigest

federated pca
Federated Principal Component Analysis Revisited!
Stars: ✭ 30 (-56.52%)
Mutual labels:  streaming-algorithms
secondary
Redis Secondary Indexing Module, been suspended see: https://github.com/RediSearch/RediSearch/
Stars: ✭ 33 (-52.17%)
Mutual labels:  redis-module
distogram
A library to compute histograms on distributed environments, on streaming data
Stars: ✭ 19 (-72.46%)
Mutual labels:  percentile
RedisTree
Redis Tree (Ploytree) Structure Module
Stars: ✭ 64 (-7.25%)
Mutual labels:  redis-module
tdigest
Wicked Fast, Accurate Quantiles Using 't-Digests'
Stars: ✭ 32 (-53.62%)
Mutual labels:  quantile
wquantiles
weighted quantiles with Python
Stars: ✭ 28 (-59.42%)
Mutual labels:  quantile
rogme
Robust Graphical Methods For Group Comparisons
Stars: ✭ 69 (+0%)
Mutual labels:  quantile
sketches-py
Python implementations of the distributed quantile sketch algorithm DDSketch
Stars: ✭ 65 (-5.8%)
Mutual labels:  quantile
EvoTrees.jl
Boosted trees in Julia
Stars: ✭ 108 (+56.52%)
Mutual labels:  quantile
Redisearch
A query and indexing engine for Redis, providing secondary indexing, full-text search, and aggregations.
Stars: ✭ 3,393 (+4817.39%)
Mutual labels:  redis-module
terraform-aws-elasticache
Terraform module to create Elasticache Cluster and replica for Redis and Memcache.
Stars: ✭ 19 (-72.46%)
Mutual labels:  redis-module
redis-protobuf
Redis module for reading and writing Protobuf messages
Stars: ✭ 153 (+121.74%)
Mutual labels:  redis-module
Miller
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
Stars: ✭ 4,633 (+6614.49%)
Mutual labels:  streaming-algorithms
ntCard
Estimating k-mer coverage histogram of genomics data
Stars: ✭ 69 (+0%)
Mutual labels:  streaming-algorithms
npstreams
Streaming operations on NumPy arrays
Stars: ✭ 28 (-59.42%)
Mutual labels:  streaming-algorithms
StreamingAlgorithms
A Set of Streaming Algorithms in C++, Python, and Go
Stars: ✭ 23 (-66.67%)
Mutual labels:  streaming-algorithms
moses
Streaming, Memory-Limited, r-truncated SVD Revisited!
Stars: ✭ 19 (-72.46%)
Mutual labels:  streaming-algorithms

redis-tdigest

Build Status

This is a Redis module for the t-digest data structure which can be used for accurate online accumulation of rank-based statistics such as quantiles and cumulative distribution at a point. The implementation is based on the Merging Digest implementation by the author.

Building & Loading

Before going ahead, make sure that the Redis server you're using has support for Redis modules.

First, you'll have to build the Redis t-digest module from source.

make

This should generate a shared library called tdigest.so in the root folder. You can now load it into Redis by using the following redis.conf configuration directive:

loadmodule /path/to/tdigest.so

Alternatively, you can load it on an already running Redis server by issuing the following commands:

MODULE LOAD /path/to/tdigest.so

API

TDIGEST.NEW key [compression]

Initializes a key to an empty t-digest structure with the compression provided or with the default compression of 400.

Reply: "OK"

TDIGEST.ADD key value count [value count ...]

Adds a value with the specified count. If key is missing, an empty t-digest structure is initialized with a default compression of 400. Returns the sum of counts for all values added.

Reply: long long

TDIGEST.MERGE destkey sourcekey [sourcekey ...]

Merges one or more sourcekey into destkey. If destkey is missing, an empty t-digest structure is initialized with a default compression of 400.

Reply: "OK"

TDIGEST.CDF key value [value ...]

Returns the cumulative distribution for all provided values. value must be a double. The cumulative distribution returned for all values is between 0..1.

Reply: double array or nil if key missing

TDIGEST.QUANTILE key quantile [quantile ...]

Returns the estimate values at all provided quantiles. quantile must be a double between 0..1.

Reply: double array or nil if key missing

TDIGEST.DEBUG key

Prints debug information about the t-digest.

Reply: bulk strings array

The reply is of the form:

1) TDIGEST (<compression>, <num_centroids>, <memory size>)
2)   CENTROID (<mean>, <weight>)
3)   CENTROID (<mean>, <weight>)
4)   CENTROID (<mean>, <weight>)
5)   ...

Centroids are printed in sorted order with respect to their mean.

Testing

The integration tests require a running Redis server so you must have redis-server on your PATH or pass its location in an environment variable called REDIS_SERVER. Tests are written in Python and use the pytest unit testing library.

make test

Contributing

Bug reports, feature and pull requests are welcome! Please add tests for any non-trivial changes you submit.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].