Title: [123938] trunk
Revision
123938
Author
[email protected]
Date
2012-07-27 17:08:44 -0700 (Fri, 27 Jul 2012)

Log Message

Unreviewed perf-o-matic build fix for dashboard image generation.
Also, only show Parser/html5-full-render on the dashboard by default
so that it won't take forever to load it.

* Websites/webkit-perf.appspot.com/controller.py:
(schedule_runs_update):
(RunsChartHandler.post):
* Websites/webkit-perf.appspot.com/models.py:
(Runs.chart_params):
(DashboardImage.get_image):
* Websites/webkit-perf.appspot.com/models_unittest.py:
(RunsTest.test_chart_params_with_value):

Modified Paths

Diff

Modified: trunk/ChangeLog (123937 => 123938)


--- trunk/ChangeLog	2012-07-27 23:51:48 UTC (rev 123937)
+++ trunk/ChangeLog	2012-07-28 00:08:44 UTC (rev 123938)
@@ -1,3 +1,18 @@
+2012-07-27  Ryosuke Niwa  <[email protected]>
+
+        Unreviewed perf-o-matic build fix for dashboard image generation.
+        Also, only show Parser/html5-full-render on the dashboard by default
+        so that it won't take forever to load it.
+
+        * Websites/webkit-perf.appspot.com/controller.py:
+        (schedule_runs_update):
+        (RunsChartHandler.post):
+        * Websites/webkit-perf.appspot.com/models.py:
+        (Runs.chart_params):
+        (DashboardImage.get_image):
+        * Websites/webkit-perf.appspot.com/models_unittest.py:
+        (RunsTest.test_chart_params_with_value):
+
 2012-07-27  Dominik Röttsches  <[email protected]>
 
         [Cairo] Add complex font drawing using HarfbuzzNG

Modified: trunk/Websites/webkit-perf.appspot.com/app.yaml (123937 => 123938)


--- trunk/Websites/webkit-perf.appspot.com/app.yaml	2012-07-27 23:51:48 UTC (rev 123937)
+++ trunk/Websites/webkit-perf.appspot.com/app.yaml	2012-07-28 00:08:44 UTC (rev 123938)
@@ -1,5 +1,5 @@
 application: webkit-perf
-version: 18
+version: 19
 runtime: python27
 api_version: 1
 threadsafe: false

Modified: trunk/Websites/webkit-perf.appspot.com/controller.py (123937 => 123938)


--- trunk/Websites/webkit-perf.appspot.com/controller.py	2012-07-27 23:51:48 UTC (rev 123937)
+++ trunk/Websites/webkit-perf.appspot.com/controller.py	2012-07-28 00:08:44 UTC (rev 123938)
@@ -88,10 +88,8 @@
 def schedule_runs_update(test_id, branch_id, platform_id, regenerate_runs=True):
     if regenerate_runs:
         taskqueue.add(url='', params={'id': test_id, 'branchid': branch_id, 'platformid': platform_id})
-    for display_days in [7]:
-        if DashboardImage.needs_update(branch_id, platform_id, test_id, display_days):
-            taskqueue.add(url='', params={'id': test_id, 'branchid': branch_id, 'platformid': platform_id,
-                'displayDays': display_days})
+    taskqueue.add(url='', params={'id': test_id, 'branchid': branch_id, 'platformid': platform_id,
+        'displayDays': 7})
 
 
 def _get_test_branch_platform_ids(handler):
@@ -135,6 +133,7 @@
 
 class RunsChartHandler(webapp2.RequestHandler):
     def post(self):
+        x = 0
         self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
         test_id, branch_id, platform_id = _get_test_branch_platform_ids(self)
 
@@ -145,7 +144,6 @@
         assert branch
         assert platform
         assert test
-
         params = Runs.update_or_insert(branch, platform, test).chart_params(display_days)
         if not params:
             return

Modified: trunk/Websites/webkit-perf.appspot.com/models.py (123937 => 123938)


--- trunk/Websites/webkit-perf.appspot.com/models.py	2012-07-27 23:51:48 UTC (rev 123937)
+++ trunk/Websites/webkit-perf.appspot.com/models.py	2012-07-28 00:08:44 UTC (rev 123938)
@@ -452,25 +452,24 @@
             self.json_averages, str(self.json_min) if self.json_min else 'null', str(self.json_max) if self.json_max else 'null',
             '"%s"' % self.test.unit if self.test.unit else 'null')
 
-    def chart_params(self, display_days, now=datetime.utcnow().replace(hour=12, minute=0, second=0, microsecond=0)):
+    def chart_params(self, display_days):
         chart_data_x = []
         chart_data_y = []
-        end_time = now
-        start_timestamp = mktime((end_time - timedelta(display_days)).timetuple())
-        end_timestamp = mktime(end_time.timetuple())
+        runs = json.loads('[' + self.json_runs + ']')
+        if not runs:
+            return None
 
-        for entry in json.loads('[' + self.json_runs + ']'):
+        end_timestamp = Runs._timestamp_and_value_from_json_entry(runs[-1])[0]
+        start_timestamp = end_timestamp - display_days * 24 * 3600
+        for entry in runs:
             timestamp, value = Runs._timestamp_and_value_from_json_entry(entry)
             if timestamp < start_timestamp or timestamp > end_timestamp:
                 continue
             chart_data_x.append(timestamp)
             chart_data_y.append(value)
 
-        if not chart_data_y:
-            return None
+        dates = [datetime.fromtimestamp(end_timestamp) - timedelta(display_days / 7.0 * (7 - i)) for i in range(0, 8)]
 
-        dates = [end_time - timedelta(display_days / 7.0 * (7 - i)) for i in range(0, 8)]
-
         y_max = max(chart_data_y) * 1.1
         y_axis_label_step = int(y_max / 5 + 0.5)  # This won't work for decimal numbers
 
@@ -508,7 +507,7 @@
         image = memcache.get('dashboard-image:' + key_name)
         if not image:
             instance = DashboardImage.get_by_key_name(key_name)
-            image = instance.image
+            image = instance.image if instance else None
             memcache.set('dashboard-image:' + key_name, image)
         return image
 

Modified: trunk/Websites/webkit-perf.appspot.com/models_unittest.py (123937 => 123938)


--- trunk/Websites/webkit-perf.appspot.com/models_unittest.py	2012-07-27 23:51:48 UTC (rev 123937)
+++ trunk/Websites/webkit-perf.appspot.com/models_unittest.py	2012-07-28 00:08:44 UTC (rev 123938)
@@ -780,7 +780,7 @@
         def split_as_int(string):
             return [int(float(value)) for value in string.split(',')]
 
-        params = Runs.update_or_insert(some_branch, some_platform, some_test).chart_params(7, end_time)
+        params = Runs.update_or_insert(some_branch, some_platform, some_test).chart_params(7)
         self.assertEqual(params['chxl'], '0:|Feb 21|Feb 22|Feb 23|Feb 24|Feb 25|Feb 26|Feb 27|Feb 28')
         self.assertEqual(split_as_int(params['chxr']), [1, 0, 57, int(52 * 1.1 / 5 + 0.5)])
         x_min, x_max, y_min, y_max = split_as_int(params['chds'])
@@ -790,7 +790,7 @@
         self.assertEqual(y_max, int(52 * 1.1))
         self.assertEqual(split_as_int(params['chg']), [int(100 / 7), 20, 0, 0])
 
-        params = Runs.update_or_insert(some_branch, some_platform, some_test).chart_params(14, end_time)
+        params = Runs.update_or_insert(some_branch, some_platform, some_test).chart_params(14)
         self.assertEqual(params['chxl'], '0:|Feb 14|Feb 16|Feb 18|Feb 20|Feb 22|Feb 24|Feb 26|Feb 28')
         self.assertEqual(split_as_int(params['chxr']), [1, 0, 57, int(52 * 1.1 / 5 + 0.5)])
         x_min, x_max, y_min, y_max = split_as_int(params['chds'])
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to