simple metrics api to interface with collectd and grafana
This commit is contained in:
@ -9,6 +9,7 @@ from owrx.source import ClientRegistry
|
||||
from owrx.connection import WebSocketMessageHandler
|
||||
from owrx.version import openwebrx_version
|
||||
from owrx.feature import FeatureDetector
|
||||
from owrx.metrics import Metrics
|
||||
|
||||
import logging
|
||||
|
||||
@ -124,6 +125,12 @@ class ApiController(Controller):
|
||||
self.send_response(data, content_type="application/json")
|
||||
|
||||
|
||||
class MetricsController(Controller):
|
||||
def handle_request(self):
|
||||
data = json.dumps(Metrics.getSharedInstance().getMetrics())
|
||||
self.send_response(data, content_type="application/json")
|
||||
|
||||
|
||||
class WebSocketController(Controller):
|
||||
def handle_request(self):
|
||||
conn = WebSocketConnection(self.handler, WebSocketMessageHandler())
|
||||
|
Reference in New Issue
Block a user