@Test public void testCollectMetricsSansCPUData() { try (ControllerMetricCollector collector = new ControllerMetricCollector(mockSpiService, mockSchedulerService, CpuDataCollector.getNullCpuDataCollector(), POLL_INTERVAL)) { collector.init(); runScheduledTask(); verifyMetric(storedRecords, MEMORY_USAGE_NAME, CONTROLLER_ID, OptionalDouble.empty()); assertEquals(1, storedRecords.size()); } }
@PostConstruct public void init() { scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval); LOG.info("Controller Metrics Collector started"); }
ControllerMetricCollector implements AutoCloseable { @PostConstruct public void init() { scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval); LOG.info("Controller Metrics Collector started"); } }
ControllerMetricCollector implements AutoCloseable { @PostConstruct public void init() { scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval); LOG.info("Controller Metrics Collector started"); } @Inject  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService); @VisibleForTesting  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final CpuDataCollector cpuDataCollector, final long pollInterval); }
ControllerMetricCollector implements AutoCloseable { @PostConstruct public void init() { scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval); LOG.info("Controller Metrics Collector started"); } @Inject  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService); @VisibleForTesting  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final CpuDataCollector cpuDataCollector, final long pollInterval); @PostConstruct void init(); @Override @PreDestroy @SuppressWarnings("checkstyle:IllegalCatch") void close(); }
ControllerMetricCollector implements AutoCloseable { @PostConstruct public void init() { scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval); LOG.info("Controller Metrics Collector started"); } @Inject  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService); @VisibleForTesting  ControllerMetricCollector(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final CpuDataCollector cpuDataCollector, final long pollInterval); @PostConstruct void init(); @Override @PreDestroy @SuppressWarnings("checkstyle:IllegalCatch") void close();  }