Package com.cobber.fta
Class Sketch
- Object
-
- Sketch
-
public class Sketch extends Object
This class is used to encapsulate a Sketch to provide Quantile data. If the data fits in the cardinality set then it simply uses a map to generate the quantiles. Once the cardinality exceeds maxCardinality then the data is tracked via DDSketch which provides for a specifiable relative-accuracy quantile sketch algorithms.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
relativeAccuracy
protected StringConverter
stringConverter
protected long
totalMapEntries
protected long
totalSketchEntries
protected FTAType
type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(String key, Long count)
void
complete(Map<String,Long> map)
protected com.datadoghq.sketch.ddsketch.DDSketch
getDdSketch()
String
getValueAtQuantile(double quantile)
Get the value at the requested quantile.boolean
isCardinalityExceeded()
boolean
isComplete()
protected void
setDdSketch(com.datadoghq.sketch.ddsketch.DDSketch ddSketch)
-
-
-
Field Detail
-
totalMapEntries
protected long totalMapEntries
-
totalSketchEntries
protected long totalSketchEntries
-
type
protected FTAType type
-
stringConverter
protected StringConverter stringConverter
-
relativeAccuracy
protected double relativeAccuracy
-
-
Method Detail
-
accept
public void accept(String key, Long count)
-
isCardinalityExceeded
public boolean isCardinalityExceeded()
-
isComplete
public boolean isComplete()
-
complete
public void complete(Map<String,Long> map)
-
getValueAtQuantile
public String getValueAtQuantile(double quantile)
Get the value at the requested quantile.- Parameters:
quantile
- a number between 0.0 and 1.0 (both included)- Returns:
- the value at the specified quantile
-
setDdSketch
protected void setDdSketch(com.datadoghq.sketch.ddsketch.DDSketch ddSketch)
-
getDdSketch
protected com.datadoghq.sketch.ddsketch.DDSketch getDdSketch()
-
-