From: Johannes Truschnigg Date: Sat, 12 Mar 2022 14:07:09 +0000 (+0100) Subject: Record pre-previous latency values, too X-Git-Url: https://johannes.truschnigg.info/gitweb/?a=commitdiff_plain;h=9675beb3e027ff168218630f489a6cfaea3a155e;p=sqm_lagthrottle Record pre-previous latency values, too Presently unused. --- diff --git a/__lagdetect.awk b/__lagdetect.awk index 6d876e7..a884cfa 100644 --- a/__lagdetect.awk +++ b/__lagdetect.awk @@ -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 }