@Test public void noMetricsToFormatIsHandled() { assertThat(protocolFormatter.format(mockMetrics, mockUri, mockAppType)).isEmpty(); }
public String format(List<MBeanMetric> metrics, URI uri, AppType appType) { StringBuilder formattedMetrics = new StringBuilder(); for(MBeanMetric metric : metrics) { MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric; formattedMetrics.append("tessera_") .append(appType) .append("_") .append(sanitize(resourceMetric.getResourceMethod())) .append(",") .append("instance=") .append(uri) .append(" ") .append(sanitize(resourceMetric.getName())) .append("=") .append(resourceMetric.getValue()) .append("\n"); } return formattedMetrics.toString().trim(); }
InfluxDbProtocolFormatter { public String format(List<MBeanMetric> metrics, URI uri, AppType appType) { StringBuilder formattedMetrics = new StringBuilder(); for(MBeanMetric metric : metrics) { MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric; formattedMetrics.append("tessera_") .append(appType) .append("_") .append(sanitize(resourceMetric.getResourceMethod())) .append(",") .append("instance=") .append(uri) .append(" ") .append(sanitize(resourceMetric.getName())) .append("=") .append(resourceMetric.getValue()) .append("\n"); } return formattedMetrics.toString().trim(); } }
InfluxDbProtocolFormatter { public String format(List<MBeanMetric> metrics, URI uri, AppType appType) { StringBuilder formattedMetrics = new StringBuilder(); for(MBeanMetric metric : metrics) { MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric; formattedMetrics.append("tessera_") .append(appType) .append("_") .append(sanitize(resourceMetric.getResourceMethod())) .append(",") .append("instance=") .append(uri) .append(" ") .append(sanitize(resourceMetric.getName())) .append("=") .append(resourceMetric.getValue()) .append("\n"); } return formattedMetrics.toString().trim(); }  }
InfluxDbProtocolFormatter { public String format(List<MBeanMetric> metrics, URI uri, AppType appType) { StringBuilder formattedMetrics = new StringBuilder(); for(MBeanMetric metric : metrics) { MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric; formattedMetrics.append("tessera_") .append(appType) .append("_") .append(sanitize(resourceMetric.getResourceMethod())) .append(",") .append("instance=") .append(uri) .append(" ") .append(sanitize(resourceMetric.getName())) .append("=") .append(resourceMetric.getValue()) .append("\n"); } return formattedMetrics.toString().trim(); }  String format(List<MBeanMetric> metrics, URI uri, AppType appType); }
InfluxDbProtocolFormatter { public String format(List<MBeanMetric> metrics, URI uri, AppType appType) { StringBuilder formattedMetrics = new StringBuilder(); for(MBeanMetric metric : metrics) { MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric; formattedMetrics.append("tessera_") .append(appType) .append("_") .append(sanitize(resourceMetric.getResourceMethod())) .append(",") .append("instance=") .append(uri) .append(" ") .append(sanitize(resourceMetric.getName())) .append("=") .append(resourceMetric.getValue()) .append("\n"); } return formattedMetrics.toString().trim(); }  String format(List<MBeanMetric> metrics, URI uri, AppType appType);  }