Commit ee1a5cd6 authored by Rafael Monnerat's avatar Rafael Monnerat

promise.check_re6st_optimal_status: Include 'acceptable lost' tolerance

  In general, We can consider that at worst 1ms is added to
  ipv4 response, due the usage of openvpn.

  We can also consider that we accept a certain increase
  on latency for various reasons, if we are on a
  congested link. So we can consider that 10% is
  reseonable enough.

  The goal of this promise it to detect the real slowliness, rather
  them minor temporary failures, due internet oscilation.
parent 0621c6c1
...@@ -20,7 +20,21 @@ def test(ipv6, ipv4, count): ...@@ -20,7 +20,21 @@ def test(ipv6, ipv4, count):
# IPv6 is unreacheable # IPv6 is unreacheable
return "FAILED" return "FAILED"
if float(result_ipv4[3]) < float(result_ipv6[3]): latency4 = float(result_ipv4[3])
latency6 = float(result_ipv6[3])
# We can consider that at worst 1ms is added to
# ipv4 response, due the usage of openvpn.
acceptable_delay = 1
# We can consider that we accept a certain increase
# on latency, if we are on a bit congested link.
# So 10% is reseonable enough.
acceptable_lost = 0.10
# Increase latency with the value.
latency4 += acceptable_delay + latency4*acceptable_lost
if latency4 < latency6:
print "Fail %s (latency4) > %s (latence6)" % (latency4, latency6)
return "FAIL" return "FAIL"
# Compare if both has Same working rate # Compare if both has Same working rate
......
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