public synchronized void addCsvReporter(final long reportIntervalInMS,
                                            final String output) {

        File outputDir = new File(output);

        if (null != csvReporter) {
            log.debug("Metrics CsvReporter already active; not creating another");
            return;
        }

        if (!outputDir.exists()) {
            if (!outputDir.mkdirs()) {
                log.warn("Failed to create CSV metrics dir {}", outputDir);
            }
        }

        csvReporter = CsvReporter.forRegistry(getRegistry()).build(outputDir);
        csvReporter.start(reportIntervalInMS, TimeUnit.MILLISECONDS);

        log.info("Configured Metrics CsvReporter configured with report interval={}ms to fileName={}", reportIntervalInMS, output);
    }
Create a {@link CsvReporter} attached to the {@code MetricsRegistry}.
<p/>
The {@code output} argument must be non-null but need not exist. If it
doesn't already exist, this method attempts to create it by calling
{@link File#mkdirs()}.

@param reportIntervalInMS milliseconds to wait between dumping metrics to CSV files in
                          the configured directory
@param output             the path to a directory into which Metrics will periodically
                          write CSV data
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java