POE collector, bandwidth metrics on/off switch, fixes/optimizations

This commit is contained in:
Arseniy Kuznetsov
2021-04-01 11:10:29 +02:00
parent 8de1ae1253
commit c7f3377c10
10 changed files with 124 additions and 29 deletions

View File

@@ -33,6 +33,9 @@ class BandwidthCollector(BaseCollector):
self.last_call_timestamp = 0
def collect(self):
if not config_handler.system_entry().bandwidth:
return
if result_list:
result_dict = result_list[0]
bandwidth_records = [{'direction': key, 'bandwidth': str(result_dict[key])} for key in ('download', 'upload')]