### Question:
JvmMetricsScheduler implements Scheduler { @Override public void run(long lastTimeSliceStartTime, long millTimeSlice) { long stopMillis = lastTimeSliceStartTime + millTimeSlice; processClassMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processGCMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processMemoryMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processBufferPoolMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processThreadMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processCompilationMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); processFileDescMetrics(lastTimeSliceStartTime, lastTimeSliceStartTime, stopMillis); } JvmMetricsScheduler(JvmClassMetricsExporter classMetricsProcessor,
                               JvmGcMetricsExporter gcMetricsProcessor,
                               JvmMemoryMetricsExporter memoryMetricsProcessor,
                               JvmBufferPoolMetricsExporter bufferPoolMetricsProcessor,
                               JvmThreadMetricsExporter threadMetricsProcessor,
                               JvmCompilationMetricsExporter compilationProcessor,
                               JvmFileDescMetricsExporter fileDescProcessor); @Override void run(long lastTimeSliceStartTime, long millTimeSlice); @Override String name();  }### Answer:
@Test public void test() { init(); String exporter = Metrics.EXPORTER_LOG_STDOUT; JvmClassMetricsExporter classExporter = MetricsExporterFactory.getClassMetricsExporter(exporter); JvmGcMetricsExporter gcExporter = MetricsExporterFactory.getGcMetricsExporter(exporter); JvmMemoryMetricsExporter memoryExporter = MetricsExporterFactory.getMemoryMetricsExporter(exporter); JvmBufferPoolMetricsExporter bufferPoolExporter = MetricsExporterFactory.getBufferPoolMetricsExporter(exporter); JvmThreadMetricsExporter threadExporter = MetricsExporterFactory.getThreadMetricsExporter(exporter); JvmCompilationMetricsExporter compilationExporter = MetricsExporterFactory.getCompilationExporter(exporter); JvmFileDescMetricsExporter fileDescExporter = MetricsExporterFactory.getFileDescExporter(exporter); JvmMetricsScheduler scheduler = new JvmMetricsScheduler( classExporter, gcExporter, memoryExporter, bufferPoolExporter, threadExporter, compilationExporter, fileDescExporter ); long startMills = System.currentTimeMillis(); for (int i = 0; i < 10; i++) { scheduler.run(startMills, startMills + i * 60 * 1000); } }