use of com.codahale.metrics.CsvReporter in project ratpack by ratpack.
the class CsvReporterProvider method get.
@Override
public CsvReporter get() {
if (config.getCsv().isPresent()) {
CsvConfig csv = config.getCsv().get();
CsvReporter.Builder builder = CsvReporter.forRegistry(metricRegistry);
if (csv.getIncludeFilter() != null || csv.getExcludeFilter() != null) {
builder.filter(new RegexMetricFilter(csv.getIncludeFilter(), csv.getExcludeFilter()));
}
return builder.build(csv.getReportDirectory());
} else {
return null;
}
}
use of com.codahale.metrics.CsvReporter in project hadoop by apache.
the class ResourceSchedulerWrapper method initMetricsCSVOutput.
private void initMetricsCSVOutput() {
int timeIntervalMS = conf.getInt(SLSConfiguration.METRICS_RECORD_INTERVAL_MS, SLSConfiguration.METRICS_RECORD_INTERVAL_MS_DEFAULT);
File dir = new File(metricsOutputDir + "/metrics");
if (!dir.exists() && !dir.mkdirs()) {
LOG.error("Cannot create directory " + dir.getAbsoluteFile());
}
final CsvReporter reporter = CsvReporter.forRegistry(metrics).formatFor(Locale.US).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build(new File(metricsOutputDir + "/metrics"));
reporter.start(timeIntervalMS, TimeUnit.MILLISECONDS);
}
use of com.codahale.metrics.CsvReporter in project hadoop by apache.
the class SLSCapacityScheduler method initMetricsCSVOutput.
private void initMetricsCSVOutput() {
int timeIntervalMS = conf.getInt(SLSConfiguration.METRICS_RECORD_INTERVAL_MS, SLSConfiguration.METRICS_RECORD_INTERVAL_MS_DEFAULT);
File dir = new File(metricsOutputDir + "/metrics");
if (!dir.exists() && !dir.mkdirs()) {
LOG.error("Cannot create directory " + dir.getAbsoluteFile());
}
final CsvReporter reporter = CsvReporter.forRegistry(metrics).formatFor(Locale.US).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build(new File(metricsOutputDir + "/metrics"));
reporter.start(timeIntervalMS, TimeUnit.MILLISECONDS);
}
Aggregations