From b6b596cd34a5a2cb88edfb56175ac2ccaca8e98b Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 21 Aug 2024 13:39:10 +0200 Subject: [PATCH] start metrics collector in start instead of initialize, which should only create objects improves symmetry with stop, should remove some warnings about unfinished coroutines in some tests --- jupyterhub/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 8bc5b937..35b9090f 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -3414,7 +3414,6 @@ class JupyterHub(Application): metrics_collector = self.metrics_collector = PeriodicMetricsCollector( parent=self, db=self.db ) - metrics_collector.start() async def cleanup(self): """Shutdown managed services and various subprocesses. Cleanup runtime files.""" @@ -3643,6 +3642,9 @@ class JupyterHub(Application): loop.stop() return + # start collecting metrics + self.metrics_collector.start() + # start the proxy if self.proxy.should_start: try: