Fix crash when measured bandwidth is zero
Change-Id: Ib19825def4a8b01c5ea53798307b0947f625b1d5
This commit is contained in:
parent
a47447a3f6
commit
b68f7fd24f
@ -173,8 +173,9 @@ class PerfTool(object):
|
|||||||
if (measured_kbps * 100 / kbps) < 80:
|
if (measured_kbps * 100 / kbps) < 80:
|
||||||
# the measured bw is too far away from the requested bw
|
# the measured bw is too far away from the requested bw
|
||||||
# take half the distance or 3x the measured bw whichever is lowest
|
# take half the distance or 3x the measured bw whichever is lowest
|
||||||
kbps = min(measured_kbps + (kbps - measured_kbps) / 2,
|
kbps = measured_kbps + (kbps - measured_kbps) / 2
|
||||||
measured_kbps * 3)
|
if measured_kbps:
|
||||||
|
kbps = min(kbps, measured_kbps * 3)
|
||||||
max_kbps = kbps
|
max_kbps = kbps
|
||||||
continue
|
continue
|
||||||
# The measured bw is within striking distance from the requested bw
|
# The measured bw is within striking distance from the requested bw
|
||||||
|
Loading…
x
Reference in New Issue
Block a user