From e97a859749a7a8b8de39b6a2b59d15fcb25d8eda Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Tue, 20 Jun 2023 19:42:47 +0000 Subject: [PATCH] fix scanner healthcheck. --- bin/scanhc.sh | 2 +- gamutrf/scan.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/scanhc.sh b/bin/scanhc.sh index 653775e1..d1d92ec2 100755 --- a/bin/scanhc.sh +++ b/bin/scanhc.sh @@ -3,7 +3,7 @@ PORT=$1 LASTUPDATE="" for i in {1..5} ; do - UPDATE=$(wget -q -O- http://0.0.0.0:$PORT/|grep -E '^last_freq_update') + UPDATE=$(wget -q -O- http://0.0.0.0:$PORT/|grep -E '^run_timestamp') if [[ "$UPDATE" == "" ]] ; then continue fi diff --git a/gamutrf/scan.py b/gamutrf/scan.py index a4379b3d..80c0fb5a 100755 --- a/gamutrf/scan.py +++ b/gamutrf/scan.py @@ -34,6 +34,7 @@ def init_prom_vars(): "tune_overlap": Gauge("tune_overlap", "multiple of samp_rate when retuning"), "tune_step_fft": Gauge("tune_step_fft", "tune FFT step (0 is use sweep_sec)"), "sweep_sec": Gauge("sweep_sec", "scan sweep rate in seconds"), + "run_timestamp": Gauge("run_timestamp", "updated when flowgraph is running"), } return prom_vars @@ -328,6 +329,7 @@ def run_loop(options, prom_vars, wavelearner): tb.start() while running and reconfigures == handler.reconfigures: idle_time = 1 + prom_vars["run_timestamp"].set(time.time()), time.sleep(idle_time) while reconfigures != handler.reconfigures: