Skip to content

Commit

Permalink
add stats output
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec42 committed Apr 25, 2024
1 parent dfc4cc8 commit 6dfbb8f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions iridiumtk/reassembler/mtpos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=[
Expand Down

0 comments on commit 6dfbb8f

Please sign in to comment.