fix a show PinglostRate bug

This commit is contained in:
ubuntu 2018-08-30 11:20:36 +08:00
parent b2141cd93c
commit 1eddbfe6e8
2 changed files with 2 additions and 8 deletions

@ -174,10 +174,7 @@ def _ping_thread(host, mark):
if 'ttl' not in buffer:
lostCount += 1
allCount += 1
# 防止吓人
if allCount < 100:
lostRate[mark] = 0.00
else:
if allCount > 100:
lostRate[mark] = float(lostCount) / allCount
endTime = time.time()
if endTime-startTime > 3600:

@ -143,10 +143,7 @@ def _ping_thread(host, mark):
if 'TTL' not in buffer.upper():
lostCount += 1
allCount += 1
# 防止吓人
if allCount < 100:
lostRate[mark] = 0.00
else:
if allCount > 100:
lostRate[mark] = float(lostCount) / allCount
endTime = time.time()
if endTime-startTime > 3600: