mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-04 08:25:58 +08:00
fix a bug
This commit is contained in:
parent
db825f050c
commit
96a4654857
@ -171,7 +171,7 @@ 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] = "%.4f" % (float(lostCount) / allCount)
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
lostCount = 0
|
lostCount = 0
|
||||||
@ -252,6 +252,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
traffic = Traffic()
|
traffic = Traffic()
|
||||||
traffic.get()
|
traffic.get()
|
||||||
|
get_packetLostRate()
|
||||||
while 1:
|
while 1:
|
||||||
CPU = get_cpu()
|
CPU = get_cpu()
|
||||||
NetRx, NetTx = traffic.get()
|
NetRx, NetTx = traffic.get()
|
||||||
|
@ -140,7 +140,7 @@ 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] = "%.4f" % (float(lostCount) / allCount)
|
lostRate[mark] = float(lostCount) / allCount
|
||||||
endTime = time.time()
|
endTime = time.time()
|
||||||
if endTime-startTime > 3600:
|
if endTime-startTime > 3600:
|
||||||
lostCount = 0
|
lostCount = 0
|
||||||
@ -221,6 +221,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
traffic = Traffic()
|
traffic = Traffic()
|
||||||
traffic.get()
|
traffic.get()
|
||||||
|
get_packetLostRate()
|
||||||
while 1:
|
while 1:
|
||||||
CPU = get_cpu()
|
CPU = get_cpu()
|
||||||
NetRx, NetTx = traffic.get()
|
NetRx, NetTx = traffic.get()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user