From 2f4e2ccffed07d90b9290e54df1f582e1eb0cb34 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 3 Dec 2023 22:41:48 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/inc/status.inc b/inc/status.inc index 70b273a6..6a84cc28 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -769,10 +769,19 @@ STATUS_SCANTIMES(){ shift done [ "${LAST}" == "" ] && LAST=480 + + echo -en "${idsCL[Yellow]}Pulling data and calculating average scan times for the last '${LAST}' scans ... " + scantimes=($(tail -n ${LAST} ${NM_LOGFOLDER}/status-check.scantimes)) + scantimes_total=0 for scantime in "${scantimes[@]}"; do - echo "HERE: $scantime" + scantimes_total=((${scantimes_total}+${scantime})) done + average=$(bc <<< "scale=1; ${scantimes_total}/${LAST}") + + echo -en "\r\033[K" + echo -e "${idsCL[LightCyan]}Average scan time for the last '${LAST}' scans : ${idsCL[Green]}${average}${idsCL[Default]}\n" + }