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:
parent
643e19b0ac
commit
eb8104be2f
@ -44,3 +44,9 @@ class Collector:
|
|||||||
if not isinstance(producer_name, StatsProducer):
|
if not isinstance(producer_name, StatsProducer):
|
||||||
raise TypeError(f'Producer {producer_name} is not a StatsProducer')
|
raise TypeError(f'Producer {producer_name} is not a StatsProducer')
|
||||||
self.producers.remove(producer_name)
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user