1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
This commit is contained in:
Kelly Brazil
2021-09-26 12:00:30 -07:00
parent 9904e0be61
commit ee075db598
4 changed files with 5 additions and 7 deletions

View File

@ -207,17 +207,16 @@ def parse(data, raw=False, quiet=False):
tstamp = '-timestamp-' in line tstamp = '-timestamp-' in line
continue continue
# skip header rows # skip header rows
if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): if (procs or disk) and (line.startswith('procs') or line.startswith('disk')):
continue continue
if 'swpd' in line and 'free' in line and 'buff' in line and 'cache' in line: if 'swpd' in line and 'free' in line and 'buff' in line and 'cache' in line:
buff_cache = True buff_cache = True
tz = line.strip().split()[-1] if tstamp else None tz = line.strip().split()[-1] if tstamp else None
continue continue
if 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line: if 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line:
buff_cache = False buff_cache = False
tz = line.strip().split()[-1] if tstamp else None tz = line.strip().split()[-1] if tstamp else None
continue continue

View File

@ -167,7 +167,6 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
tstamp = '-timestamp-' in line tstamp = '-timestamp-' in line
continue continue
# skip header rows # skip header rows
if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): if (procs or disk) and (line.startswith('procs') or line.startswith('disk')):
continue continue