@Test public void testDeadPodCurator() throws IOException, ParseException { String integrationId = "intId1"; MetricsCollector collector = new MetricsCollector(null, jsondb, null); Set<String> livePodIds = new HashSet<String>( Arrays.asList("pod2", "pod3", "pod4", "pod5")); jsondb.update(JsonDBRawMetrics.path("intId1","pod1"), JsonUtils.writer().writeValueAsString(raw("intId1","1","pod1",12L,"31-01-2018 10:22:56"))); Map<String,RawMetrics> metrics = jsondbRM.getRawMetrics(integrationId); IntegrationMetricsSummary summary = intMH .compute(integrationId, metrics, livePodIds); assertThat(summary.getMessages()).isEqualTo(18); assertThat(summary.getErrors()).isEqualTo(3); assertThat(summary.getStart().get()).isEqualTo(ZonedDateTime.of(2018, 01, 31, 10, 22, 56, 0, ZoneId.of("Z")).toInstant()); collector.close(); }
@Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); }
MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } }
MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired  MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); }
MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired  MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("FutureReturnValueIgnored") void open(); @Override void close(); @Override void run(); }
MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired  MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("FutureReturnValueIgnored") void open(); @Override void close(); @Override void run();  }