Modified: trunk/ChangeLog (111472 => 111473)
--- trunk/ChangeLog 2012-03-21 00:24:49 UTC (rev 111472)
+++ trunk/ChangeLog 2012-03-21 00:30:28 UTC (rev 111473)
@@ -1,3 +1,21 @@
+2012-03-20 Ryosuke Niwa <[email protected]>
+
+ Perf-o-matic: don't query datastore to generate chart API urls
+ https://bugs.webkit.org/show_bug.cgi?id=81499
+
+ Reviewed by Hajime Morita.
+
+ Parse json text to extract timestamps and test values instead of iterating
+ through the data store.
+
+ * Websites/webkit-perf.appspot.com/create_handler.py:
+ (CreateHandler.post):
+ * Websites/webkit-perf.appspot.com/models.py:
+ (Runs._timestamp_and_value_from_json_entry):
+ (Runs):
+ (Runs.to_json):
+ (Runs.chart_params):
+
2012-03-20 Gyuyoung Kim <[email protected]>
Convert hasSpellingMarker to use Internals interface.
Modified: trunk/Websites/webkit-perf.appspot.com/create_handler.py (111472 => 111473)
--- trunk/Websites/webkit-perf.appspot.com/create_handler.py 2012-03-21 00:24:49 UTC (rev 111472)
+++ trunk/Websites/webkit-perf.appspot.com/create_handler.py 2012-03-21 00:30:28 UTC (rev 111473)
@@ -64,7 +64,7 @@
# No need to clear manifest or runs since they only contain ones with test results
schedule_dashboard_update()
- self.response.out.write(error + '\n' if error else 'OK')
+ self.response.out.write(error + '\n' if error else 'OK\n')
def _create_builder(self, name, password):
if not name or not password:
Modified: trunk/Websites/webkit-perf.appspot.com/models.py (111472 => 111473)
--- trunk/Websites/webkit-perf.appspot.com/models.py 2012-03-21 00:24:49 UTC (rev 111472)
+++ trunk/Websites/webkit-perf.appspot.com/models.py 2012-03-21 00:30:28 UTC (rev 111473)
@@ -356,6 +356,10 @@
builder_id, statistics]
@staticmethod
+ def _timestamp_and_value_from_json_entry(json_entry):
+ return json_entry[2], json_entry[3]
+
+ @staticmethod
def _key_name(branch_id, platform_id, test_id):
return 'runs:%d,%d,%d' % (test_id, branch_id, platform_id)
@@ -417,7 +421,6 @@
return '{"test_runs": [%s], "averages": {%s}, "min": %s, "max": %s, "date_range": null, "stat": "ok"}' % (self.json_runs,
self.json_averages, str(self.json_min) if self.json_min else 'null', str(self.json_max) if self.json_max else 'null')
- # FIXME: Use data in JSON to compute values to avoid iterating through the datastore.
def chart_params(self, display_days, now=datetime.now().replace(hour=12, minute=0, second=0, microsecond=0)):
chart_data_x = []
chart_data_y = []
@@ -425,12 +428,12 @@
start_timestamp = mktime((end_time - timedelta(display_days)).timetuple())
end_timestamp = mktime(end_time.timetuple())
- for build, result in self._generate_runs(self.branch, self.platform, self.test.name):
- timestamp = mktime(build.timestamp.timetuple())
+ for entry in json.loads('[' + self.json_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(result.value)
+ chart_data_y.append(value)
dates = [end_time - timedelta(display_days / 7.0 * (7 - i)) for i in range(0, 8)]