mirror of
https://github.com//cppla/ServerStatus
synced 2025-06-02 05:39:50 +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():
|
||||
lostCount += 1
|
||||
allCount += 1
|
||||
lostRate[mark] = float(lostCount) / allCount
|
||||
# 防止吓人
|
||||
if allCount < 100:
|
||||
lostRate[mark] = 0.00
|
||||
else:
|
||||
lostRate[mark] = float(lostCount) / allCount
|
||||
endTime = time.time()
|
||||
if endTime-startTime > 3600:
|
||||
lostCount = 0
|
||||
|
@ -140,7 +140,11 @@ def _ping_thread(host, mark):
|
||||
if 'TTL' not in output.readline().upper():
|
||||
lostCount += 1
|
||||
allCount += 1
|
||||
lostRate[mark] = float(lostCount) / allCount
|
||||
# 防止吓人
|
||||
if allCount < 100:
|
||||
lostRate[mark] = 0.00
|
||||
else:
|
||||
lostRate[mark] = float(lostCount) / allCount
|
||||
endTime = time.time()
|
||||
if endTime-startTime > 3600:
|
||||
lostCount = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user