Skip to content

Instantly share code, notes, and snippets.

@dalexandrov
Created February 23, 2021 14:52
Show Gist options
  • Save dalexandrov/12735b48c259148ebff2a0a8892cba45 to your computer and use it in GitHub Desktop.
Save dalexandrov/12735b48c259148ebff2a0a8892cba45 to your computer and use it in GitHub Desktop.
private void refreshMetrics(ScheduledExecutorService executor) {
Collection<ConnectionPoolMetrics> currentPoolMetrics = driver.metrics().connectionPoolMetrics();
if (!metricsInitialized.get() && currentPoolMetrics.size() >= 1) {
lastPoolMetrics.set(currentPoolMetrics);
reinit();
if (metricsInitialized.get()) {
reinitFuture.get().cancel(false);
executor.shutdown();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment