@Test public void testSubmit() { ReportQueue reportQueue = new ReportQueue(new ReportClientConfig().setEnabled(true), clientExecutorService, reportClient); reportQueue.report(100, TESTING_METRIC_DATA); verify(clientExecutorService).submit(any(Runnable.class)); verify(reportClient).report(100, TESTING_METRIC_DATA); verifyNoMoreInteractions(reportClient); }
@Override public void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData) { if (!enabled) { return; } clientExecutorService.submit(() -> reportClient.report(systemTimeMillis, collectedData)); }
ReportQueue implements ReportSink { @Override public void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData) { if (!enabled) { return; } clientExecutorService.submit(() -> reportClient.report(systemTimeMillis, collectedData)); } }
ReportQueue implements ReportSink { @Override public void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData) { if (!enabled) { return; } clientExecutorService.submit(() -> reportClient.report(systemTimeMillis, collectedData)); } @Inject  ReportQueue(ReportClientConfig reportClientConfig, @ForReportClient ExecutorService clientExecutorService, ReportClient reportClient); }
ReportQueue implements ReportSink { @Override public void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData) { if (!enabled) { return; } clientExecutorService.submit(() -> reportClient.report(systemTimeMillis, collectedData)); } @Inject  ReportQueue(ReportClientConfig reportClientConfig, @ForReportClient ExecutorService clientExecutorService, ReportClient reportClient); @Override void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData); }
ReportQueue implements ReportSink { @Override public void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData) { if (!enabled) { return; } clientExecutorService.submit(() -> reportClient.report(systemTimeMillis, collectedData)); } @Inject  ReportQueue(ReportClientConfig reportClientConfig, @ForReportClient ExecutorService clientExecutorService, ReportClient reportClient); @Override void report(long systemTimeMillis, Table<String, Map<String, String>, Object> collectedData);  }