mirror of
https://github.com/jketterl/openwebrx.git
synced 2025-12-06 07:12:09 +01:00
introduce metrics for HFDL and VDL2
This commit is contained in:
parent
81b51360d8
commit
26b8c53374
|
|
@ -2,6 +2,7 @@ from pycsdr.modules import ExecModule
|
|||
from pycsdr.types import Format
|
||||
from owrx.aeronautical import AirplaneLocation, AcarsProcessor, IcaoSource
|
||||
from owrx.map import Map, Source
|
||||
from owrx.metrics import Metrics, CounterMetric
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
import logging
|
||||
|
|
@ -43,6 +44,11 @@ class DumpHFDLModule(ExecModule):
|
|||
|
||||
class HFDLMessageParser(AcarsProcessor):
|
||||
def __init__(self):
|
||||
name = "dumphfdl.decodes.hfdl"
|
||||
self.metrics = Metrics.getSharedInstance().getMetric(name)
|
||||
if self.metrics is None:
|
||||
self.metrics = CounterMetric()
|
||||
Metrics.getSharedInstance().addMetric(name, self.metrics)
|
||||
super().__init__("HFDL")
|
||||
|
||||
def process(self, line):
|
||||
|
|
@ -69,6 +75,8 @@ class HFDLMessageParser(AcarsProcessor):
|
|||
except Exception:
|
||||
logger.exception("error processing HFDL data")
|
||||
|
||||
self.metrics.inc()
|
||||
|
||||
return msg
|
||||
|
||||
def processPosition(self, hfnpdu, icao=None):
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from pycsdr.types import Format
|
|||
from owrx.aeronautical import AcarsProcessor
|
||||
from owrx.map import Map
|
||||
from owrx.aeronautical import AirplaneLocation, IcaoSource
|
||||
from owrx.metrics import Metrics, CounterMetric
|
||||
|
||||
import logging
|
||||
|
||||
|
|
@ -26,6 +27,11 @@ class DumpVDL2Module(ExecModule):
|
|||
|
||||
class VDL2MessageParser(AcarsProcessor):
|
||||
def __init__(self):
|
||||
name = "dumpvdl2.decodes.vdl2"
|
||||
self.metrics = Metrics.getSharedInstance().getMetric(name)
|
||||
if self.metrics is None:
|
||||
self.metrics = CounterMetric()
|
||||
Metrics.getSharedInstance().addMetric(name, self.metrics)
|
||||
super().__init__("VDL2")
|
||||
|
||||
def process(self, line):
|
||||
|
|
@ -55,6 +61,7 @@ class VDL2MessageParser(AcarsProcessor):
|
|||
self.processReport(report_data, src)
|
||||
except Exception:
|
||||
logger.exception("error processing VDL2 data")
|
||||
self.metrics.inc()
|
||||
return msg
|
||||
|
||||
def processReport(self, report, icao):
|
||||
|
|
|
|||
Loading…
Reference in a new issue