From 6dfbb8f0aa82d406d0a1efc14bb44cd61ee9b58f Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 25 Apr 2024 22:32:20 +0200 Subject: [PATCH] add stats output --- iridiumtk/reassembler/mtpos.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/iridiumtk/reassembler/mtpos.py b/iridiumtk/reassembler/mtpos.py index 701d476..9f52642 100644 --- a/iridiumtk/reassembler/mtpos.py +++ b/iridiumtk/reassembler/mtpos.py @@ -26,6 +26,11 @@ def __init__(self): super().__init__() global json import json + if config.stats: + from util import curses_eol + global eol + eol=curses_eol() + def consume(self, q): (data, time, ul, _, freq)=q @@ -79,6 +84,11 @@ def consume(self, q): with open(temp_file_path, "w") as f: print(json.dumps({"time": int(time), "interval": self.intvl, "mt_pos": self.mt_pos}, separators=(',', ':')), file=f) os.rename(temp_file_path, ofile) + if config.stats: + sts=dt.epoch(int(time)) + mts=len(self.mt_pos) + print("%s: %d MTs"%(sts,mts), end=eol, file=sys.stderr) + modes=[