    def stop(self):
        """
        Stop collecting metrics
        """
        for pc in self._periodic_callbacks.values():
            pc.stop()
        for task in self._tasks.values():
            task.cancel()
Stop collecting metrics
jupyterhub/metrics.py