statistics: Exit loop as soon as MemAvailable found

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-03-22 22:04:40 -04:00
parent 6aae62542c
commit 6b7e917a8e
1 changed files with 1 additions and 0 deletions

View File

@ -16,6 +16,7 @@ def get_os_stats(eventtime):
for line in data.split('\n'): for line in data.split('\n'):
if line.startswith("MemAvailable:"): if line.startswith("MemAvailable:"):
msg = "%s memavail=%s" % (msg, line.split()[1]) msg = "%s memavail=%s" % (msg, line.split()[1])
break
except: except:
pass pass
return (False, msg) return (False, msg)