move metrics initialization to have initial metrics
This commit is contained in:
		| @@ -1,5 +1,4 @@ | ||||
| from owrx.config import Config | ||||
| from owrx.metrics import Metrics, DirectMetric | ||||
| import threading | ||||
|  | ||||
| import logging | ||||
| @@ -24,7 +23,6 @@ class ClientRegistry(object): | ||||
|  | ||||
|     def __init__(self): | ||||
|         self.clients = [] | ||||
|         Metrics.getSharedInstance().addMetric("openwebrx.users", DirectMetric(self.clientCount)) | ||||
|         super().__init__() | ||||
|  | ||||
|     def broadcast(self): | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| import threading | ||||
| from owrx.client import ClientRegistry | ||||
|  | ||||
|  | ||||
| class Metric(object): | ||||
| @@ -38,6 +39,7 @@ class Metrics(object): | ||||
|  | ||||
|     def __init__(self): | ||||
|         self.metrics = {} | ||||
|         self.addMetric("openwebrx.users", DirectMetric(ClientRegistry.getSharedInstance().clientCount)) | ||||
|  | ||||
|     def addMetric(self, name, metric): | ||||
|         self.metrics[name] = metric | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jakob Ketterl
					Jakob Ketterl