]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Record pre-previous latency values, too
authorJohannes Truschnigg <johannes@truschnigg.info>
Sat, 12 Mar 2022 14:07:09 +0000 (15:07 +0100)
committerJohannes Truschnigg <johannes@truschnigg.info>
Sat, 12 Mar 2022 14:07:09 +0000 (15:07 +0100)
Presently unused.

__lagdetect.awk

index 6d876e70b28796ebd5a689f0237d72bf02aa893b..a884cfab48765e1569544b0bba4e1bf32b44769d 100644 (file)
@@ -11,13 +11,13 @@ BEGIN {
     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
+    ping_pprev[pn]=-1 # latency recorded in the previous cycle
     not_increasing_count[pn]=0 # number of consecutive cycles with no (fudged) latency increase
   }
 }
 
 
 # 192.168.1.50 : [0], timed out (NaN avg, 100% loss)
-
 /, timed out / {
   pn=$1
   seq=$3
@@ -26,6 +26,7 @@ BEGIN {
   print "TIMEOUT for " pn
 }
 
+
 # 1.1.1.1      : [0], 1288 bytes, 10.3 ms (10.3 avg, 0% loss)
 /[0-9] bytes, [0-9]*.[0-9]* ms / {
   pn=$1
@@ -43,6 +44,7 @@ BEGIN {
     thresh_fudged = (FUDGE + (ping_avgs[pn] * THRESHOLD))
     if (last2avg > thresh_fudged ) {
       print "LATENCY ++ " last2avg " " thresh_fudged " prev=" ping_prev[pn] " lat=" lat " host=" pn
+      # print "CONSIDER BW DECREASE" # need better way to make this call
       not_increasing_count[pn]=0
     } else {
       print "LATENCY == " last2avg " " thresh_fudged " prev=" ping_prev[pn] " lat=" lat " host=" pn
@@ -55,6 +57,7 @@ BEGIN {
   } else {
     # print "NODATA"
   }
+  ping_pprev[pn]=ping_prev[pn]
   ping_prev[pn]=lat
 }