Package com.wavefront.agent.histogram
Class HistogramUtils
- java.lang.Object
-
- com.wavefront.agent.histogram.HistogramUtils
-
public final class HistogramUtils extends Object
Helpers around histograms- Author:
- Tim Schmidt ([email protected]).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HistogramUtils.HistogramKeyMarshaller
(For now, a rather trivial) encoding ofHistogramKey
the form short length and bytes Consider using chronicle-values or making this stateful with a local byte[] / Stringbuffers to be a little more efficient about encodings.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
granularityToString(Granularity granularity)
Convert granularity to string.static HistogramKey
makeKey(wavefront.report.ReportPoint point, Granularity granularity)
static void
mergeHistogram(com.tdunning.math.stats.TDigest target, wavefront.report.Histogram source)
Merges a histogram into a TDigeststatic wavefront.report.ReportPoint
pointFromKeyAndDigest(HistogramKey histogramKey, AgentDigest agentDigest)
-
-
-
Method Detail
-
makeKey
public static HistogramKey makeKey(wavefront.report.ReportPoint point, Granularity granularity)
-
pointFromKeyAndDigest
public static wavefront.report.ReportPoint pointFromKeyAndDigest(HistogramKey histogramKey, AgentDigest agentDigest)
- Parameters:
histogramKey
- the key, defining metric, source, annotations, duration and start-timeagentDigest
- the digest defining the centroids- Returns:
- the corresponding point
-
granularityToString
public static String granularityToString(@Nullable Granularity granularity)
Convert granularity to string. If null, we assume we are dealing with "distribution" port.- Parameters:
granularity
- granularity- Returns:
- string representation
-
mergeHistogram
public static void mergeHistogram(com.tdunning.math.stats.TDigest target, wavefront.report.Histogram source)
Merges a histogram into a TDigest- Parameters:
target
- target TDigestsource
- histogram to merge
-
-