mirror of
https://github.com/craigerl/aprsd.git
synced 2025-08-12 18:22:25 -04:00
Lock on stats for PacketList
This commit is contained in:
parent
5ff62c9bdf
commit
f59b65d13c
@ -84,13 +84,13 @@ class PacketList(objectstore.ObjectStoreMixin):
|
|||||||
def total_tx(self):
|
def total_tx(self):
|
||||||
return self._total_tx
|
return self._total_tx
|
||||||
|
|
||||||
|
@wrapt.synchronized(lock)
|
||||||
def stats(self, serializable=False) -> dict:
|
def stats(self, serializable=False) -> dict:
|
||||||
stats = {
|
stats = {
|
||||||
"total_tracked": self.total_tx() + self.total_rx(),
|
"total_tracked": self._total_rx + self._total_rx,
|
||||||
"rx": self.total_rx(),
|
"rx": self._total_rx,
|
||||||
"tx": self.total_tx(),
|
"tx": self._total_tx,
|
||||||
"types": self.data["types"],
|
"types": self.data["types"],
|
||||||
"packets": self.data["packets"],
|
"packets": self.data["packets"],
|
||||||
}
|
}
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
|
Loading…
x
Reference in New Issue
Block a user