public class MergingDigest extends AbstractTDigest
| Compression | N | k |
| 50 | 78 | 25 |
| 100 | 157 | 42 |
| 200 | 314 | 73 |
| Modifier and Type | Class and Description |
|---|---|
static class |
MergingDigest.Encoding |
| Constructor and Description |
|---|
MergingDigest(double compression)
Allocates a buffer merging t-digest.
|
MergingDigest(double compression,
int bufferSize)
If you know the size of the temporary buffer for incoming points, you can use this entry point.
|
MergingDigest(double compression,
int bufferSize,
int size)
Fully specified constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x,
int w)
Adds a sample to a histogram.
|
void |
add(List<? extends TDigest> others) |
void |
asBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
void |
asSmallBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
int |
byteSize()
Returns the number of bytes required to encode this TDigest using #asBytes().
|
double |
cdf(double x)
Returns the fraction of all points added which are <= x.
|
int |
centroidCount() |
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 MergingDigest |
fromBytes(ByteBuffer buf) |
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()
Turns on internal data recording.
|
long |
size()
Returns the number of points that have been added to this TDigest.
|
int |
smallByteSize()
Returns the number of bytes required to encode this TDigest using #asSmallBytes().
|
add, add, createCentroid, isRecordingcreateAvlTreeDigest, createDigest, createMergingDigest, getMax, getMinpublic MergingDigest(double compression)
compression - The compression factorpublic MergingDigest(double compression,
int bufferSize)
compression - Compression factor for t-digest. Same as 1/\delta in the paper.bufferSize - How many samples to retain before merging.public MergingDigest(double compression,
int bufferSize,
int size)
compression - Compression factorbufferSize - Number of temporary centroidssize - Size of main bufferpublic TDigest recordAllData()
recordAllData in class AbstractTDigestpublic void add(double x,
int w)
TDigestpublic void compress()
TDigestpublic long size()
TDigestpublic double cdf(double x)
TDigestpublic double quantile(double q)
TDigestpublic int centroidCount()
centroidCount in class 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()
TDigestpublic int smallByteSize()
TDigestsmallByteSize in class TDigestpublic void asBytes(ByteBuffer buf)
TDigestpublic void asSmallBytes(ByteBuffer buf)
TDigestasSmallBytes in class TDigestbuf - The byte buffer into which the TDigest should be serialized.public static MergingDigest fromBytes(ByteBuffer buf)
Copyright © 2017. All rights reserved.