mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-05 00:45:59 +08:00
防止吓人~
This commit is contained in:
parent
e80575bf12
commit
41fba68a17
@ -171,7 +171,11 @@ def _ping_thread(host, mark):
|
|||||||
if 'ttl' not in output.readline():
|
if 'ttl' not in output.readline():
|
||||||
lostCount += 1
|
lostCount += 1
|
||||||
allCount += 1
|
allCount += 1
|
||||||
lostRate[mark] = float(lostCount) / allCount
|
# 防止吓人
|
||||||
|
if allCount < 100:
|
||||||
|
lostRate[mark] = 0.00
|
||||||
|
else:
|
||||||
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
lostCount = 0
|
lostCount = 0
|
||||||
|
@ -140,7 +140,11 @@ def _ping_thread(host, mark):
|
|||||||
if 'TTL' not in output.readline().upper():
|
if 'TTL' not in output.readline().upper():
|
||||||
lostCount += 1
|
lostCount += 1
|
||||||
allCount += 1
|
allCount += 1
|
||||||
lostRate[mark] = float(lostCount) / allCount
|
# 防止吓人
|
||||||
|
if allCount < 100:
|
||||||
|
lostRate[mark] = 0.00
|
||||||
|
else:
|
||||||
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
lostCount = 0
|
lostCount = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user