Search in sources :

Example 1 with CsvReporter

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;
    }
}
Also used : CsvConfig(ratpack.dropwizard.metrics.CsvConfig) CsvReporter(com.codahale.metrics.CsvReporter)

Example 2 with CsvReporter

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);
}
Also used : File(java.io.File) CsvReporter(com.codahale.metrics.CsvReporter)

Example 3 with CsvReporter

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);
}
Also used : File(java.io.File) CsvReporter(com.codahale.metrics.CsvReporter)

Aggregations

CsvReporter (com.codahale.metrics.CsvReporter)3 File (java.io.File)2 CsvConfig (ratpack.dropwizard.metrics.CsvConfig)1