@Test void testPrometheusDataNoTypeDups() throws Exception { Set<String> found = new HashSet<>(); String data = MetricsSupport.toPrometheusData(app, base); try (BufferedReader reader = new BufferedReader(new StringReader(data))) { String line; while ((line = reader.readLine()) != null) { String[] tokens = line.split(" "); if (tokens.length > 3 && tokens[1].equals("TYPE")) { String metric = tokens[2]; assertFalse(found.contains(metric)); found.add(metric); } } } }
static String toPrometheusData(Registry... registries) { return Arrays.stream(registries) .filter(r -> !r.empty()) .map(MetricsSupport::toPrometheusData) .collect(Collectors.joining()); }
MetricsSupport implements Service { static String toPrometheusData(Registry... registries) { return Arrays.stream(registries) .filter(r -> !r.empty()) .map(MetricsSupport::toPrometheusData) .collect(Collectors.joining()); } }
MetricsSupport implements Service { static String toPrometheusData(Registry... registries) { return Arrays.stream(registries) .filter(r -> !r.empty()) .map(MetricsSupport::toPrometheusData) .collect(Collectors.joining()); } private  MetricsSupport(Builder builder); }
MetricsSupport implements Service { static String toPrometheusData(Registry... registries) { return Arrays.stream(registries) .filter(r -> !r.empty()) .map(MetricsSupport::toPrometheusData) .collect(Collectors.joining()); } private  MetricsSupport(Builder builder); static MetricsSupport create(); static MetricsSupport create(Config config); static Builder builder(); static String toPrometheusData(MetricID metricID, Metric metric, boolean withHelpType); static String toPrometheusData(String name, Metric metric, boolean withHelpType); void configureVendorMetrics(String routingName,
            Routing.Rules rules); void configureEndpoint(Routing.Rules rules); @Override void update(Routing.Rules rules); }
MetricsSupport implements Service { static String toPrometheusData(Registry... registries) { return Arrays.stream(registries) .filter(r -> !r.empty()) .map(MetricsSupport::toPrometheusData) .collect(Collectors.joining()); } private  MetricsSupport(Builder builder); static MetricsSupport create(); static MetricsSupport create(Config config); static Builder builder(); static String toPrometheusData(MetricID metricID, Metric metric, boolean withHelpType); static String toPrometheusData(String name, Metric metric, boolean withHelpType); void configureVendorMetrics(String routingName,
            Routing.Rules rules); void configureEndpoint(Routing.Rules rules); @Override void update(Routing.Rules rules);  }