From 6114a518de8d2db560db193ed4bc26d6e1659ce7 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 31 Jan 2014 08:21:24 -0500 Subject: [PATCH] fix sar reporting in the gate the sar filter made an assumption of time display including an AM/PM... which isn't true in all environments. Hence the blank sysstat screen in the gate runs of late. This fixes that, and displays the first line which includes header version to make sure we are functioning. Change-Id: I537e0bf2127efaf337c4792bc23d938145c8990d --- tools/sar_filter.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/sar_filter.py b/tools/sar_filter.py index ed8c19687c..24ef0e476c 100755 --- a/tools/sar_filter.py +++ b/tools/sar_filter.py @@ -25,10 +25,10 @@ def is_data_line(line): def parse_line(line): - m = re.search('(\d\d:\d\d:\d\d \w\w)(\s+((\S+)\s*)+)', line) + m = re.search('(\d\d:\d\d:\d\d( \w\w)?)(\s+((\S+)\s*)+)', line) if m: date = m.group(1) - data = m.group(2).rstrip() + data = m.group(3).rstrip() return date, data else: return None, None @@ -47,6 +47,10 @@ header = "" data_line = "" printed_header = False current_ts = None + +# print out the first sysstat line regardless +print process.stdout.readline() + while True: nextline = process.stdout.readline() if nextline == '' and process.poll() is not None: