From 2d5bbb85e67c8764df7699df6a0e1d25f7df02ef Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 5 Dec 2023 21:39:21 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index b3ea2389..add940b9 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -785,6 +785,9 @@ STATUS_SCANTIMES(){ echo -en "${idsCL[Yellow]}Pulling data and calculating average scan times for the last '${LAST}' scans ... " + lastten_scantimes=($(tail -n 10 ${NM_LOGFOLDER}/status-check.scantimes)) + lastscantime=$(tail -n 1 ${NM_LOGFOLDER}/status-check.scantimes) + scantimes=($(tail -n ${LAST} ${NM_LOGFOLDER}/status-check.scantimes)) scantimes_total=0; scansfound=0 for scantime in "${scantimes[@]}"; do @@ -793,9 +796,15 @@ STATUS_SCANTIMES(){ done average=$(bc <<< "scale=2; ${scantimes_total}/${scansfound}") - echo -en "\r\033[K" - echo -e "${idsCL[LightCyan]}Average scan time for the last '${scansfound}' scans : ${idsCL[Green]}$(SHOW_TIME ${average} s)${idsCL[Default]}\n" + echo -en "\r\033[K" + echo -e "${idsCL[LightCyan]}Average for last '${scansfound}' : ${idsCL[Green]}$(SHOW_TIME ${average} s) (${average}s)${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Last Scan Time : ${idsCL[Green]}$(SHOW_TIME ${lastscantime} s) (${lastscantime}s)${idsCL[Default]}\n" + echo -e "${idsCL[LightCyan]}Last 10 Scan Times\n${idsCL[Green]}-------------------------${idsCL[Default]}" + for scantime in "${lastten_scantimes[@]}"; do + echo -e "${idsCL[White]} $(SHOW_TIME ${scantime} s) (${scantime}s)${idsCL[Default]}" + done + echo }