mirror of
https://github.com//cppla/ServerStatus
synced 2025-12-14 17:52:05 +08:00
fix a show PinglostRate bug
This commit is contained in:
@@ -174,10 +174,7 @@ def _ping_thread(host, mark):
|
|||||||
if 'ttl' not in buffer:
|
if 'ttl' not in buffer:
|
||||||
lostCount += 1
|
lostCount += 1
|
||||||
allCount += 1
|
allCount += 1
|
||||||
# 防止吓人
|
if allCount > 100:
|
||||||
if allCount < 100:
|
|
||||||
lostRate[mark] = 0.00
|
|
||||||
else:
|
|
||||||
lostRate[mark] = float(lostCount) / allCount
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
|
|||||||
@@ -143,10 +143,7 @@ def _ping_thread(host, mark):
|
|||||||
if 'TTL' not in buffer.upper():
|
if 'TTL' not in buffer.upper():
|
||||||
lostCount += 1
|
lostCount += 1
|
||||||
allCount += 1
|
allCount += 1
|
||||||
# 防止吓人
|
if allCount > 100:
|
||||||
if allCount < 100:
|
|
||||||
lostRate[mark] = 0.00
|
|
||||||
else:
|
|
||||||
lostRate[mark] = float(lostCount) / allCount
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
|
|||||||
Reference in New Issue
Block a user