Search in sources :

Example 1 with FilteredMetricsExporter

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());
}
Also used : FilteredMetricsExporter(fish.payara.microprofile.metrics.writer.FilteredMetricsExporter) MetricsWriterImpl(fish.payara.microprofile.metrics.writer.MetricsWriterImpl) HashSet(java.util.HashSet) MonitoredMetric(fish.payara.nucleus.healthcheck.configuration.MonitoredMetric)

Aggregations

FilteredMetricsExporter (fish.payara.microprofile.metrics.writer.FilteredMetricsExporter)1 MetricsWriterImpl (fish.payara.microprofile.metrics.writer.MetricsWriterImpl)1 MonitoredMetric (fish.payara.nucleus.healthcheck.configuration.MonitoredMetric)1 HashSet (java.util.HashSet)1