]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Improve comments and error messages
authorJohannes Truschnigg <johannes@truschnigg.info>
Sat, 12 Mar 2022 13:52:59 +0000 (14:52 +0100)
committerJohannes Truschnigg <johannes@truschnigg.info>
Sat, 12 Mar 2022 13:52:59 +0000 (14:52 +0100)
__lagdetect.awk

index 249928cdeccb419e7abc45238b5358e90b5931fb..6d876e70b28796ebd5a689f0237d72bf02aa893b 100644 (file)
@@ -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)