Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Unified Diff: bench/bench_graph_svg.py

Issue 13762002: Switches to a Skia-specific appengine entry point that uses condensed data and taskqueue writes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/bench_graph_svg.py
===================================================================
--- bench/bench_graph_svg.py (revision 8549)
+++ bench/bench_graph_svg.py (working copy)
@@ -23,17 +23,6 @@
TITLE_PREAMBLE = 'Bench_Performance_for_Skia_'
TITLE_PREAMBLE_LENGTH = len(TITLE_PREAMBLE)
-# Number of data points to send to appengine at once.
-DATA_POINT_BATCHSIZE = 66
-
-def grouper(n, iterable):
- """Groups list into list of lists for a given size. See itertools doc:
- http://docs.python.org/2/library/itertools.html#module-itertools
- """
- args = [iter(iterable)] * n
- return [[n for n in t if n] for t in itertools.izip_longest(*args)]
-
-
def usage():
"""Prints simple usage information."""
@@ -413,7 +402,7 @@
newest_revision: the latest revision that this script reads
bot: the bot platform the bench is run on
"""
- data = []
+ config_data_dic = {}
for label in line_data_dict.iterkeys():
if not label.bench.endswith('.skp') or label.time_type:
# filter out non-picture and non-walltime benches
@@ -424,23 +413,28 @@
# data point we have for each line.
if rev != newest_revision:
continue
- data.append({'master': 'Skia', 'bot': bot,
- 'test': config + '/' + label.bench.replace('.skp', ''),
- 'revision': rev, 'value': val, 'error': 0})
- for curr_data in grouper(DATA_POINT_BATCHSIZE, data):
- req = urllib2.Request(appengine_url,
- urllib.urlencode({'data': json.dumps(curr_data)}))
- try:
- urllib2.urlopen(req)
- except urllib2.HTTPError, e:
- sys.stderr.write("HTTPError for JSON data %s: %s\n" % (
- data, e))
- except urllib2.URLError, e:
- sys.stderr.write("URLError for JSON data %s: %s\n" % (
- data, e))
- except httplib.HTTPException, e:
- sys.stderr.write("HTTPException for JSON data %s: %s\n" % (
- data, e))
+ if config not in config_data_dic:
+ config_data_dic[config] = []
+ config_data_dic[config].append(label.bench.replace('.skp', '') +
+ ':%.2f' % val)
+ for config in config_data_dic:
+ if config_data_dic[config]:
+ data = {'master': 'Skia', 'bot': bot, 'test': config,
+ 'revision': newest_revision,
+ 'benches': ','.join(config_data_dic[config])}
+ req = urllib2.Request(appengine_url,
+ urllib.urlencode({'data': json.dumps(data)}))
+ try:
+ urllib2.urlopen(req)
+ except urllib2.HTTPError, e:
+ sys.stderr.write("HTTPError for JSON data %s: %s\n" % (
+ data, e))
+ except urllib2.URLError, e:
+ sys.stderr.write("URLError for JSON data %s: %s\n" % (
+ data, e))
+ except httplib.HTTPException, e:
+ sys.stderr.write("HTTPException for JSON data %s: %s\n" % (
+ data, e))
try:
for option, value in opts:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698