move metrics initialization to have initial metrics
This commit is contained in:
parent
9e323a08ff
commit
480b728c06
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user