mirror of https://github.com/cppla/ServerStatus
防止吓人~
parent
cedab0e55a
commit
c418f4fecf
|
@ -171,6 +171,10 @@ 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
|
||||||
|
# 防止吓人
|
||||||
|
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:
|
||||||
|
|
|
@ -140,6 +140,10 @@ 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
|
||||||
|
# 防止吓人
|
||||||
|
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:
|
||||||
|
|
Loading…
Reference in New Issue