default Iterable<MetricName> readNames() { return readAllMetrics().getNames(); }
default Iterable<MetricName> readNames() { return readAllMetrics().getNames(); }
@Override public Set<String> metrics() { logger.debug("Listing the matched metrics"); try { final Metrics rawMetrics = readMetrics(); final Metrics metrics = transformValues(rawMetrics); final Set<String> result = new TreeSet<>(); metrics.getNames().forEach(i -> result.add(i.getName())); return result; } catch (final OpenMetricsReaderException e) { final String msg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); logger.warn("Failed to open reader: {}", msg); } catch (final MetricReadException e) { logger.warn("Failed to read metrics", e); } catch (final MetricWriteException e) { logger.warn("Failed to write metrics", e); } return Collections.emptySet(); }
@Override public Set<String> metrics() { logger.debug("Listing the matched metrics"); try { final Metrics rawMetrics = readMetrics(); final Metrics metrics = transformValues(rawMetrics); final Set<String> result = new TreeSet<>(); metrics.getNames().forEach(i -> result.add(i.getName())); return result; } catch (final OpenMetricsReaderException e) { final String msg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); logger.warn("Failed to open reader: {}", msg); } catch (final MetricReadException e) { logger.warn("Failed to read metrics", e); } catch (final MetricWriteException e) { logger.warn("Failed to write metrics", e); } return Collections.emptySet(); }