@Test public void shouldExtractMetricFromReportKey() { ReportEntry reportEntry = new ReportEntry("a.b.c.d.e-f", ReportEntryType.COUNTER, "1000"); ExtractedMetric result = DurationReportEntryMetricExtraction.extractMetricFromReportEntry(reportEntry); assertEquals("a_b_c_d_ef_seconds", result.getMetricName()); assertTrue(result.getLabelValues().isEmpty()); assertEquals(1.0, result.getValue(), 1e-3); }
public static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry) { String metricName = defaultMetricName(reportEntry); double value = millisecondsToSeconds(Double.parseDouble(reportEntry.getValue().toString())); return new ExtractedMetric(metricName, Collections.emptyList(), Collections.emptyList(), value); }
DurationReportEntryMetricExtraction { public static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry) { String metricName = defaultMetricName(reportEntry); double value = millisecondsToSeconds(Double.parseDouble(reportEntry.getValue().toString())); return new ExtractedMetric(metricName, Collections.emptyList(), Collections.emptyList(), value); } }
DurationReportEntryMetricExtraction { public static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry) { String metricName = defaultMetricName(reportEntry); double value = millisecondsToSeconds(Double.parseDouble(reportEntry.getValue().toString())); return new ExtractedMetric(metricName, Collections.emptyList(), Collections.emptyList(), value); } private  DurationReportEntryMetricExtraction(); }
DurationReportEntryMetricExtraction { public static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry) { String metricName = defaultMetricName(reportEntry); double value = millisecondsToSeconds(Double.parseDouble(reportEntry.getValue().toString())); return new ExtractedMetric(metricName, Collections.emptyList(), Collections.emptyList(), value); } private  DurationReportEntryMetricExtraction(); static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry); }
DurationReportEntryMetricExtraction { public static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry) { String metricName = defaultMetricName(reportEntry); double value = millisecondsToSeconds(Double.parseDouble(reportEntry.getValue().toString())); return new ExtractedMetric(metricName, Collections.emptyList(), Collections.emptyList(), value); } private  DurationReportEntryMetricExtraction(); static ExtractedMetric extractMetricFromReportEntry(ReportEntry reportEntry);  }