Lens AI Profiler Cpp
|
A sketch data structure for approximate quantile estimation. More...
#include <kll.h>
Public Member Functions | |
KLLSketch (int maxBins) | |
Constructs a KLLSketch object with the specified maximum number of bins. More... | |
void | update (double value) |
Updates the sketch with a new data point. More... | |
double | getQuantile (double quantile) |
Estimates the quantile of the data stream represented by the sketch. More... | |
A sketch data structure for approximate quantile estimation.
This class represents a KLL sketch, which can be used to estimate quantiles of a data stream in an approximate but memory-efficient way.
KLLSketch::KLLSketch | ( | int | maxBins | ) |
Constructs a KLLSketch object with the specified maximum number of bins.
A sketch data structure for approximate quantile estimation using the KLL algorithm.
maxBins | The maximum number of bins to store in the sketch. |
This class implements the KLL sketch data structure, which can be used to estimate quantiles of a data stream in an approximate but memory-efficient way.
Constructs a KLLSketch object with the specified maximum number of bins.
maxBins | The maximum number of bins to store in the sketch. |
double KLLSketch::getQuantile | ( | double | quantile | ) |
Estimates the quantile of the data stream represented by the sketch.
This function estimates the value at a specific quantile (e.g., median) based on the data points stored in the sketch.
quantile | The quantile value (between 0.0 and 1.0). |
void KLLSketch::update | ( | double | value | ) |
Updates the sketch with a new data point.
This function adds a new data point to the sketch and maintains the internal state for quantile estimation. If the number of data points exceeds the maximum number of bins, the mergeBins() function is called to reduce the number of bins.
value | The data point to be added to the sketch. |