Rename and fix up hack script.
authorCarl Hetherington <cth@carlh.net>
Mon, 14 Oct 2019 13:57:23 +0000 (15:57 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 14 Oct 2019 13:57:23 +0000 (15:57 +0200)
hacks/test_timings [new file with mode: 0644]
hacks/testtimings [deleted file]

diff --git a/hacks/test_timings b/hacks/test_timings
new file mode 100644 (file)
index 0000000..517d9ff
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import sys
+
+if len(sys.argv) < 2:
+    print>>sys.stderr,'Syntax %s <log>' % sys.argv[0]
+    sys.exit(1)
+
+tests = {}
+
+with open(sys.argv[1]) as f:
+    while True:
+        l = f.readline()
+        if l == '':
+            break
+
+        s = l.split()
+        if len(s) > 2 and s[1] == 'Leaving' and s[7][-2:] == 'us':
+            tests[float(s[7][:-2]) / 1000000] = s[4][1:-2]
+
+def hms(x):
+    h = int(x) // 3600
+    x -= h * 3600
+    m = int(x) // 60
+    x -= m * 60
+    return '%02d:%02d:%02d' % (h, m, x)
+
+for x in sorted(tests):
+    print hms(x),tests[x]
diff --git a/hacks/testtimings b/hacks/testtimings
deleted file mode 100644 (file)
index f4e8084..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/python
-
-import sys
-
-if len(sys.argv) < 2:
-    print>>sys.stderr,'Syntax %s <log>' % sys.argv[0]
-    sys.exit(1)
-
-tests = {}
-
-with open(sys.argv[1]) as f:
-    while True:
-        l = f.readline()
-        if l == '':
-            break
-
-        s = l.split()
-        if len(s) == 7 and s[6][-3:] == 'mks':
-            tests[float(s[6][:-3]) / 1000000] = s[3][1:-2]
-
-for x in sorted(tests):
-    print x,tests[x]