]> rtime.felk.cvut.cz Git - nul-nightly.git/blobdiff - wvperf2html.py
New nightly build log
[nul-nightly.git] / wvperf2html.py
index 3f10861df14c81cc521d47eda47978bc09cc3d8c..b690f634fdc0312dabd5c8c8f09f717d1b90c03a 100755 (executable)
@@ -121,25 +121,13 @@ class Graph:
     def findRanges(self):
         for axis in list(self.axes.values()):
             cols = [col for col in list(self.columns.values()) if col.axis == axis]
-            low = None
-            high = None
-            all_in_range = True
+            values = []
             for col in cols:
-                values = np.array([row[col.name] for row in self.rows if row[col.name] != None], np.float64)
-                if low == None and high == None:
-                    lastmonth = values[-30:]
-                    median = np.median(lastmonth)
-                    low  = median * 0.95
-                    high = median * 1.05
-
-                if (values > high).any() or (values < low).any():
-                    all_in_range = False
-            if all_in_range:
-                axis.yrange_max = high
-                axis.yrange_min = low
-            else:
-                axis.yrange_max = None
-                axis.yrange_min = None
+                allvalues = np.array([row[col.name] for row in self.rows if row[col.name] != None], np.float64)
+                lastmonth = allvalues[-30:]
+                values.extend(lastmonth);
+            if len(values) > 0:
+                axis.minrange = np.mean(values)/10.0
 
     def fixupAxisNumbers(self):
         # Sort axes according to the columns and number them
@@ -179,9 +167,12 @@ class Graph:
             },
             'plotOptions': {
                 'series': {
-                            'events': {
+                    'events': {
                         'click': "FUN(series_onclick)END",
-                            }
+                    },
+                    'dataGrouping' : {
+                        'enabled' : False,
+                    },
                 }
             },
             'yAxis': [{
@@ -189,8 +180,7 @@ class Graph:
                     'labels': { 'align': 'right',
                         'x': -3 },
                     'title': { 'text': axis.getLabel() },
-                    'min': axis.yrange_min,
-                    'max': axis.yrange_max,
+                    'minRange': axis.minrange,
                     } for axis in self.axes_ordered],
             'series': [{ 'name': '%s [%s]' % (col.name, col.units),
                  'yAxis': col.axis.num }
@@ -296,17 +286,17 @@ print("""
       return s;
     }
     function series_onclick(event) {
-      var lastpoint = null;
+      var prevpoint = null;
       for (var i in this.data) {
         if (event.point == this.data[i]) {
-          if (i > 0) lastpoint = this.data[i-1];
+          if (i > 0) prevpoint = this.data[i-1];
           break;
         }
       }
-      if (lastpoint)
-        window.location = "http://os.inf.tu-dresden.de/~jsteckli/cgi-bin/cgit.cgi/nul/log/?qt=range&q="+date2commit[lastpoint.x]+'..'+date2commit[event.point.x].hash;
+      if (prevpoint && date2commit[prevpoint.x] != date2commit[event.point.x])
+        window.location = "https://github.com/TUD-OS/NUL/compare/"+date2commit[prevpoint.x]+'...'+date2commit[event.point.x];
       else
-        window.location = "http://os.inf.tu-dresden.de/~jsteckli/cgi-bin/cgit.cgi/nul/log/?id="+date2commit[event.point.x];
+        window.location = "https://github.com/TUD-OS/NUL/commit/"+date2commit[event.point.x];
     }""")
 
 def make_int_keys(json):