fix a bug

This commit is contained in:
ubuntu 2018-08-28 19:33:36 +08:00
parent db825f050c
commit 96a4654857
2 changed files with 4 additions and 2 deletions

@ -171,7 +171,7 @@ def _ping_thread(host, mark):
if 'ttl' not in output.readline():
lostCount += 1
allCount += 1
lostRate[mark] = "%.4f" % (float(lostCount) / allCount)
lostRate[mark] = float(lostCount) / allCount
endTime = time.time()
if endTime-startTime > 3600:
lostCount = 0
@ -252,6 +252,7 @@ if __name__ == '__main__':
traffic = Traffic()
traffic.get()
get_packetLostRate()
while 1:
CPU = get_cpu()
NetRx, NetTx = traffic.get()

@ -140,7 +140,7 @@ def _ping_thread(host, mark):
if 'TTL' not in output.readline().upper():
lostCount += 1
allCount += 1
lostRate[mark] = "%.4f" % (float(lostCount) / allCount)
lostRate[mark] = float(lostCount) / allCount
endTime = time.time()
if endTime-startTime > 3600:
lostCount = 0
@ -221,6 +221,7 @@ if __name__ == '__main__':
traffic = Traffic()
traffic.get()
get_packetLostRate()
while 1:
CPU = get_cpu()
NetRx, NetTx = traffic.get()