Skip to content

Commit bc08c1a

Browse files
committed
ft-orchestration manual probe track running state and jq calculate timestamps if missing
1 parent 52a84c2 commit bc08c1a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tools/ft-orchestration/src/collector/jq.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def __init__(self, executor: Executor, file: str):
103103
ipfixcol2 -c {Path(self._conf_dir, self.CONFIG_FILE)} | jq -r "
104104
.[\\"iana:sourceIPAddress\\"] = (.\\"iana:sourceIPv4Address\\" // .\\"iana:sourceIPv6Address\\") |
105105
.[\\"iana:destinationIPAddress\\"] = (.\\"iana:destinationIPv4Address\\" // .\\"iana:destinationIPv6Address\\") |
106+
107+
.[\\"iana:flowStartMilliseconds\\"] //= .[\\"iana:systemInitTimeMilliseconds\\"] + .[\\"iana:flowStartSysUpTime\\"] |
108+
.[\\"iana:flowEndMilliseconds\\"] //= .[\\"iana:systemInitTimeMilliseconds\\"] + .[\\"iana:flowEndSysUpTime\\"] |
106109
del(
107110
.\\"iana:sourceIPv4Address\\",
108111
.\\"iana:sourceIPv6Address\\",

tools/ft-orchestration/src/probe/manual.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ def __init__(
4545
):
4646
self._timeouts = (active_timeout, inactive_timeout)
4747
self.host_statistics = EmptyHostStats(executor, "")
48+
self.running = False
4849

4950
def start(self):
5051
logging.warning("start probe now")
5152
for i in range(10, -1, -1):
5253
logging.info(i)
5354
time.sleep(1)
55+
self.running = True
5456

5557
def supported_fields(self):
5658
pass
@@ -59,11 +61,15 @@ def get_special_fields(self):
5961
pass
6062

6163
def stop(self):
64+
if not self.running:
65+
return
66+
6267
logging.warning("you can stop the probe now")
6368
wait_time = max(self._timeouts)
6469
for i in range(wait_time, -1, -1):
6570
logging.info(i)
6671
time.sleep(1)
72+
self.running = False
6773

6874
def cleanup(self):
6975
pass

0 commit comments

Comments
 (0)