/** * Creates a {@link ReportPoint} from a {@link HistogramKey} - {@link AgentDigest} pair * * @param histogramKey the key, defining metric, source, annotations, duration and start-time * @param agentDigest the digest defining the centroids * @return the corresponding point */ public static ReportPoint pointFromKeyAndDigest(HistogramKey histogramKey, AgentDigest agentDigest) { return ReportPoint.newBuilder() .setTimestamp(histogramKey.getBinTimeMillis()) .setMetric(histogramKey.getMetric()) .setHost(histogramKey.getSource()) .setAnnotations(histogramKey.getTagsAsMap()) .setTable("dummy") .setValue(agentDigest.toHistogram((int) histogramKey.getBinDurationInMillis())) .build(); }
/** * Creates a {@link ReportPoint} from a {@link HistogramKey} - {@link AgentDigest} pair * * @param histogramKey the key, defining metric, source, annotations, duration and start-time * @param agentDigest the digest defining the centroids * @return the corresponding point */ public static ReportPoint pointFromKeyAndDigest(HistogramKey histogramKey, AgentDigest agentDigest) { return ReportPoint.newBuilder() .setTimestamp(histogramKey.getBinTimeMillis()) .setMetric(histogramKey.getMetric()) .setHost(histogramKey.getSource()) .setAnnotations(histogramKey.getTagsAsMap()) .setTable("dummy") .setValue(agentDigest.toHistogram((int) histogramKey.getBinDurationInMillis())) .build(); }