/** * Enables the CSV reporter for the default metrics registry, and causes it to write to files in * {@code outputDir} with the specified period. * * @param outputDir the directory in which {@code .csv} files will be created * @param period the period between successive outputs * @param unit the time unit of {@code period} */ public static void enable(File outputDir, long period, TimeUnit unit) { enable(Metrics.defaultRegistry(), outputDir, period, unit); }
/** Process csv options */ private void processCsv() { if (csvEnabled()) { File dir = new File(csvDirectory); try { FileUtils.deleteDirectory(dir); // CHECKSTYLE: stop EmptyBlock } catch (IOException e) { } // CHECKSTYLE: resume EmptyBlock if (!dir.mkdirs()) { LOG.error("Failed to create CSV directory " + dir); } CsvReporter.enable(dir, csvPrintSecs, TimeUnit.SECONDS); } }
break; case FILE: CsvReporter.enable(outputDir, 1, TimeUnit.SECONDS); break;
break; case FILE: CsvReporter.enable(outputDir, 1, TimeUnit.SECONDS); break;