public class AVLTreeDigest extends AbstractTDigest
| Modifier and Type | Field and Description |
|---|---|
static int |
SMALL_ENCODING |
static int |
VERBOSE_ENCODING |
gen, recordAllData| Constructor and Description |
|---|
AVLTreeDigest(double compression)
A histogram structure that will record a sketch of a distribution.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x,
int w)
Adds a sample to a histogram.
|
void |
add(double x,
int w,
List<Double> data) |
void |
asBytes(ByteBuffer buf)
Outputs a histogram as bytes using a particularly cheesy encoding.
|
void |
asSmallBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
int |
byteSize()
Returns an upper bound on the number bytes that will be required to represent this histogram.
|
double |
cdf(double x)
Returns the fraction of all points added which are <= x.
|
Collection<Centroid> |
centroids()
A
Collection that lets you go through the centroids in ascending order by mean. |
void |
compress()
Re-examines a t-digest to determine whether some centroids are redundant.
|
double |
compression()
Returns the current compression factor.
|
static AVLTreeDigest |
fromBytes(ByteBuffer buf)
Reads a histogram from a byte buffer
|
double |
quantile(double q)
Returns an estimate of the cutoff such that a specified fraction of the data
added to this TDigest would be less than or equal to the cutoff.
|
TDigest |
recordAllData()
Sets up so that all centroids will record all data assigned to them.
|
long |
size()
Returns the number of samples represented in this histogram.
|
int |
smallByteSize()
Returns an upper bound on the number of bytes that will be required to represent this histogram in
the tighter representation.
|
add, add, createCentroid, decode, encode, interpolate, isRecording, merge, weightedAverage, weightedAverageSortedcheckValue, createArrayDigest, createArrayDigest, createAvlTreeDigest, createDigest, createTreeDigestpublic static final int VERBOSE_ENCODING
public static final int SMALL_ENCODING
public AVLTreeDigest(double compression)
compression - How should accuracy be traded for size? A value of N here will give quantile errors
almost always less than 3/N with considerably smaller errors expected for extreme
quantiles. Conversely, you should expect to track about 5 N centroids for this
accuracy.public TDigest recordAllData()
AbstractTDigestrecordAllData in class AbstractTDigestpublic void add(double x,
int w)
TDigestpublic void compress()
TDigestpublic long size()
public double cdf(double x)
TDigestpublic double quantile(double q)
TDigestpublic Collection<Centroid> centroids()
TDigestCollection that lets you go through the centroids in ascending order by mean. Centroids
returned will not be re-used, but may or may not share storage with this TDigest.public double compression()
TDigestcompression in class TDigestpublic int byteSize()
public int smallByteSize()
smallByteSize in class TDigestpublic void asBytes(ByteBuffer buf)
public void asSmallBytes(ByteBuffer buf)
TDigestasSmallBytes in class TDigestbuf - The byte buffer into which the TDigest should be serialized.public static AVLTreeDigest fromBytes(ByteBuffer buf)
Copyright © 2015. All rights reserved.