in geronimo-microprofile-reporter/src/main/java/org/apache/geronimo/microprofile/reporter/storage/front/ReporterEndpoints.java [82:111]
private void init() {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
chartJs = (chartJsResource.startsWith("/") ?
Stream.of(chartJsResource, chartJsResource.substring(1)) : Stream.of(chartJsResource, '/' + chartJsResource))
.map(it -> {
final InputStream stream = loader.getResourceAsStream(it);
if (stream == null) {
return null;
}
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(
requireNonNull(stream,
"Chart.js bundle not found")))) {
return reader.lines().collect(joining("\n"));
} catch (final IOException e) {
throw new IllegalStateException("Didn't find chart.js bundle");
}
})
.filter(Objects::nonNull)
.findFirst()
.orElseThrow(() -> new IllegalStateException("No " + chartJsResource + " found, did you add org.webjars.bower:chart.js:2.7.3 to your classpath?"));
tiles = new ArrayList<>(7);
if (tracing.isActive()) {
tiles.add("Spans");
}
tiles.addAll(asList("Counters", "Gauges", "Histograms", "Meters", "Timers"));
if (health.isActive()) {
tiles.add("Health Checks");
}
}