Browse code

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

Sean Dague authored on 2014/01/31 22:21:24
Showing 1 changed files
... ...
@@ -25,10 +25,10 @@ def is_data_line(line):
25 25
 
26 26
 
27 27
 def parse_line(line):
28
-    m = re.search('(\d\d:\d\d:\d\d \w\w)(\s+((\S+)\s*)+)', line)
28
+    m = re.search('(\d\d:\d\d:\d\d( \w\w)?)(\s+((\S+)\s*)+)', line)
29 29
     if m:
30 30
         date = m.group(1)
31
-        data = m.group(2).rstrip()
31
+        data = m.group(3).rstrip()
32 32
         return date, data
33 33
     else:
34 34
         return None, None
... ...
@@ -47,6 +47,10 @@ header = ""
47 47
 data_line = ""
48 48
 printed_header = False
49 49
 current_ts = None
50
+
51
+# print out the first sysstat line regardless
52
+print process.stdout.readline()
53
+
50 54
 while True:
51 55
     nextline = process.stdout.readline()
52 56
     if nextline == '' and process.poll() is not None: