Commit 9ff09ea9 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Instantly warn if thresholds are exceeded by 30%

parent ec432103
Pipeline #7404 passed with stage
in 4 minutes and 17 seconds
......@@ -50,9 +50,11 @@ class ConnectionWatchdog(private val trafficStats: TrafficStats,
val currentLatency = trafficStats.floatingAverageLatency.toInt()
val currentPacketLossPercent = (100*trafficStats.failedAnswers)/(trafficStats.packetsReceivedFromDevice*0.9)
if(latencyAtLastCheck?.let { it > badLatencyThresholdMs } == true && currentLatency > badLatencyThresholdMs) {
if(currentLatency > badLatencyThresholdMs*1.3 ||
(latencyAtLastCheck?.let { it > badLatencyThresholdMs } == true && currentLatency > badLatencyThresholdMs)) {
callCallback()
} else if(packetLossAtLastCheck?.let { it > badPacketLossThresholdPercent } == true && currentPacketLossPercent > badPacketLossThresholdPercent) {
} else if(currentPacketLossPercent > badPacketLossThresholdPercent*1.3 || (
packetLossAtLastCheck?.let { it > badPacketLossThresholdPercent } == true && currentPacketLossPercent > badPacketLossThresholdPercent)) {
callCallback()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment