From 5a0ef3d1381b5bfcbf4d61275c5093f38d97988c Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Sat, 12 Mar 2022 14:52:59 +0100 Subject: [PATCH] Improve comments and error messages --- __lagdetect.awk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/__lagdetect.awk b/__lagdetect.awk index 249928c..6d876e7 100644 --- a/__lagdetect.awk +++ b/__lagdetect.awk @@ -6,12 +6,12 @@ BEGIN { split(PING_PEERS, pps, " ") for (pp in pps) { pn = pps[pp] - print "ping peer: " pn - slotindex[pn]=0 - have_baseline[pn]=0 - ping_avgs[pn]=-1 - ping_prev[pn]=-1 - not_increasing_count[pn]=0 + print "PEERS+=" pn + slotindex[pn]=0 # used to cycle thru PINGSLOTS per PEER + have_baseline[pn]=0 # do we have enough data to make informed decisions? + ping_avgs[pn]=-1 # mean of last PINGSLOTS recorded latencies per PEER + ping_prev[pn]=-1 # latency recorded in the previous cycle + not_increasing_count[pn]=0 # number of consecutive cycles with no (fudged) latency increase } } @@ -33,7 +33,7 @@ BEGIN { bytes=$4 lat=$6 if (! (pn in slotindex)) { - print "BOGUS PEER: " pn + print "FATAL: BOGUS PEER: " pn exit 1 } #printf("%s %db in %.2fms\n", pn, bytes, lat) -- 2.39.5