Use a strong reference to the application shutdown gauge

This commit is contained in:
Chris Eager
2022-02-16 13:58:02 -08:00
committed by Chris Eager
parent 31e2be2e4d
commit a2c4d3fe95
2 changed files with 12 additions and 6 deletions

View File

@@ -727,7 +727,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
environment.healthChecks().register("cacheCluster", new RedisClusterHealthCheck(cacheCluster));
environment.lifecycle().manage(new ApplicationShutdownMonitor());
environment.lifecycle().manage(new ApplicationShutdownMonitor(Metrics.globalRegistry));
environment.metrics().register(name(CpuUsageGauge.class, "cpu"), new CpuUsageGauge(3, TimeUnit.SECONDS));
environment.metrics().register(name(FreeMemoryGauge.class, "free_memory"), new FreeMemoryGauge());