X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/d9fcff2b1bf6f83198e2450d66199f979aadc49f..86b24990fbd85d1e6d19de6bde4982a8c1cc0fd0:/continuous/www/wvperf2html.py
diff --git a/continuous/www/wvperf2html.py b/continuous/www/wvperf2html.py
index 0fed0ed..38bd2ea 100755
--- a/continuous/www/wvperf2html.py
+++ b/continuous/www/wvperf2html.py
@@ -17,22 +17,21 @@ import os
import os.path
import string
import time
+from datetime import timedelta,datetime
import numpy as np
import json
re_prefix = "\([0-9]+\) (?:# )?"
-re_date = re.compile('^! Date: (.*) ok')
+re_date = re.compile('^! Date: (.*?) ok')
re_testing = re.compile('^('+re_prefix+')?\s*Testing "(.*)" in (.*):\s*$')
-re_commit = re.compile('.*(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}).*, commit: (.*)')
-re_commithash = re.compile('([0-9a-f]{7})(-dirty)? \(')
+re_repo = re.compile('^! Repo (?P[^ ]*) (?P[^ ]*) (?P[0-9a-f]*) ok')
re_assertion = re.compile('^('+re_prefix+')?!\s*(.*?)\s+(\S+)\s*$')
re_perf = re.compile('^('+re_prefix+')?!\s*(.*?)\s+PERF:\s*(.*?)\s+(\S+)\s*$')
re_perfaxis = re.compile('axis="([^"]+)"')
def dateConv(date):
- d = time.gmtime(time.mktime(date))
- return int(time.mktime(d))*1000
+ return int(time.mktime(date.timetuple()))*1000
class Axis:
@@ -93,6 +92,8 @@ class Graph:
return self.rows[rownum]
def addValue(self, date, col, val, units):
+ if col == "gw_latency" and val == 0:
+ val = None
row = self[date]
row[col] = val
if col not in self.columns:
@@ -145,8 +146,11 @@ class Graph:
def options_json(self):
options = {
+ 'chart': {
+ 'borderWidth': 1,
+ },
'rangeSelector': {
- 'selected': 2 # 6m
+ 'selected': 5 # All
},
'title': {
'text': self.title
@@ -175,12 +179,16 @@ class Graph:
},
}
},
+ 'xAxis': {
+ 'ordinal' : False,
+ },
'yAxis': [{
'lineWidth': 1,
'labels': { 'align': 'right',
'x': -3 },
'title': { 'text': axis.getLabel() },
'minRange': axis.minrange,
+ 'tickPixelInterval': 40,
} for axis in self.axes_ordered],
'series': [{ 'name': '%s [%s]' % (col.name, col.units),
'yAxis': col.axis.num }
@@ -189,7 +197,7 @@ class Graph:
return json.dumps(options, indent=True).replace('"FUN(', '').replace(')END"', '')
def getData(self):
- data = [[[row.getDate(), row[col.name]] for row in self.rows] for col in self.columns_ordered]
+ data = [[[row.getDate(), row[col.name]] for row in sorted(self.rows, cmp, lambda r: r.date)] for col in self.columns_ordered]
return json.dumps(data).replace('], [', '],\n[')
@@ -200,33 +208,35 @@ graphs = Graphs()
date2commit = {}
commit2msg = {}
-date = time.localtime(time.time())
+date = datetime.now()
for line in sys.stdin:
line = line.rstrip()
match = re_date.match(line)
if (match):
- date = time.strptime(match.group(1), "%Y-%m-%d %H:%M:%S")
+ dstr = match.group(1)
+ words = dstr.split()
+
+ date = datetime.strptime(string.join(words[0:2]), "%Y-%m-%d %H:%M:%S")
+ if (len(words) > 2):
+ zone_hours = int(words[2])/100
+ date -= timedelta(hours = zone_hours)
continue
+ match = re_repo.match(line)
+ if (match):
+ url = match.group('url')
+ desc = match.group('desc')
+ hash = match.group('hash')
+
+ date2commit[date] = hash
+ commit2msg[hash] = desc
+
match = re_testing.match(line)
if match:
what = match.group(2)
where = match.group(3)
-
- match = re_commit.match(what)
- if match:
- date = time.strptime(match.group(1), "%Y-%m-%d %H:%M:%S")
- commit = match.group(2)
- match = re_commithash.search(commit);
- if match:
- commithash = match.group(1)
- else:
- commithash = None
- date2commit[dateConv(date)] = commithash
- commit2msg[commithash] = commit
-
(basename, ext) = os.path.splitext(os.path.basename(where))
if what != "all": title = what
@@ -268,17 +278,18 @@ for g in graphs:
g.findRanges()
g.fixupAxisNumbers()
+pagetitle="Linux CAN subsystem performance plots"
print("""
- NUL Performance Plots
+ %(pagetitle)s
-
+
- NUL Performance Plots
+ %(pagetitle)s
The graphs below show performance numbers from various
- benchmarks that run nightly on NUL repository.
+ CAN bus related benchmarks run on different Linux kernel versions.
Table of content:
-""")
+""" % locals())
for graph in graphs:
- print(" - %s
" % (graph.title, graph.title))
+ print(" - %s
" % (graph.id, graph.title))
print("
")
for graph in graphs:
print("""
-
+