1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-10-13 10:47:50 -04:00

Added stop_all to stats collector.

This unregisters all of the registered stats producers,
which in effect disables collecting.  This is called during
teardown of aprsd.
This commit is contained in:
Walter Boring 2025-10-09 10:52:30 -04:00
parent 643e19b0ac
commit eb8104be2f

View File

@ -44,3 +44,9 @@ class Collector:
if not isinstance(producer_name, StatsProducer):
raise TypeError(f'Producer {producer_name} is not a StatsProducer')
self.producers.remove(producer_name)
def stop_all(self):
"""Stop and unregister all registered stats producers."""
for producer in self.producers[:]:
LOG.info(f'Stopping Stats producer {producer}')
self.unregister_producer(producer)