use of fish.payara.microprofile.metrics.writer.FilteredMetricsExporter in project Payara by payara.
the class MicroProfileMetricsCheck method constructOptions.
@Override
public synchronized HealthCheckMicroProfileMetricstExecutionOptions constructOptions(MicroProfileMetricsChecker checker) {
Set<String> metricNames = new HashSet<>();
for (MonitoredMetric metric : checker.getMonitoredMetrics()) {
metricNames.add(metric.getMetricName());
}
this.buffer = new StringWriterProxy();
this.writer = new MetricsWriterImpl(new FilteredMetricsExporter(buffer, metricNames), metricsService.getContextNames(), metricsService::getContext);
return new HealthCheckMicroProfileMetricstExecutionOptions(Boolean.valueOf(checker.getEnabled()), Long.parseLong(checker.getTime()), asTimeUnit(checker.getUnit()), Boolean.valueOf(checker.getAddToMicroProfileHealth()), checker.getMonitoredMetrics());
}
Aggregations