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

Side by Side Diff: bench/bench_graph_svg.py

Issue 21157003: Adds links to dashboard plots for skp bench values out of range. (SkipBuildbotRuns). (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ''' 1 '''
2 Created on May 16, 2011 2 Created on May 16, 2011
3 3
4 @author: bungeman 4 @author: bungeman
5 ''' 5 '''
6 import bench_util 6 import bench_util
7 import getopt 7 import getopt
8 import httplib 8 import httplib
9 import itertools 9 import itertools
10 import json 10 import json
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 expectation) 369 expectation)
370 bench_entry = elements[0] + ',' + elements[1] 370 bench_entry = elements[0] + ',' + elements[1]
371 if bench_entry in expectations: 371 if bench_entry in expectations:
372 raise Exception("Dup entries for bench expectation %s" % 372 raise Exception("Dup entries for bench expectation %s" %
373 bench_entry) 373 bench_entry)
374 # [<Bench_BmpConfig_TimeType>,<Platform-Alg>] -> (LB, UB) 374 # [<Bench_BmpConfig_TimeType>,<Platform-Alg>] -> (LB, UB)
375 expectations[bench_entry] = (float(elements[-2]), 375 expectations[bench_entry] = (float(elements[-2]),
376 float(elements[-1])) 376 float(elements[-1]))
377 377
378 def check_expectations(lines, expectations, newest_revision, key_suffix): 378 def check_expectations(lines, expectations, newest_revision, key_suffix):
379 """Check if there are benches in latest rev outside expected range.""" 379 """Check if there are benches in latest rev outside expected range.
380 For exceptions, also outputs URL link for the dashboard plot.
381 The link history token format here only works for single-line plots.
382 """
383 # The platform for this bot, to pass to the dashboard plot.
384 platform = key_suffix[ : key_suffix.rfind('-')]
385 # Starting revision for the dashboard plot.
386 start_rev = str(newest_revision - 100) # Displays about 100 revisions.
380 exceptions = [] 387 exceptions = []
381 for line in lines: 388 for line in lines:
382 line_str = str(line) 389 line_str = str(line)
383 bench_platform_key = (line_str[ : line_str.find('_{')] + ',' + 390 line_str = line_str[ : line_str.find('_{')]
384 key_suffix) 391 bench_platform_key = line_str + ',' + key_suffix
385 this_revision, this_bench_value = lines[line][-1] 392 this_revision, this_bench_value = lines[line][-1]
386 if (this_revision != newest_revision or 393 if (this_revision != newest_revision or
387 bench_platform_key not in expectations): 394 bench_platform_key not in expectations):
388 # Skip benches without value for latest revision. 395 # Skip benches without value for latest revision.
389 continue 396 continue
390 this_min, this_max = expectations[bench_platform_key] 397 this_min, this_max = expectations[bench_platform_key]
391 if this_bench_value < this_min or this_bench_value > this_max: 398 if this_bench_value < this_min or this_bench_value > this_max:
392 exceptions.append('Bench %s value %s out of range [%s, %s].' % 399 link = ''
393 (bench_platform_key, this_bench_value, this_min, this_max)) 400 # For skp benches out of range, create dashboard plot link.
401 if line_str.find('.skp_') > 0:
402 # Extract bench and config for dashboard plot.
403 bench, config = line_str.strip('_').split('.skp_')
404 link = ' <a href="'
405 link += 'http://go/skpdash/SkpDash.html#%s~%s~%s~%s" ' % (
406 start_rev, bench, platform, config)
407 link += 'target="_blank">graph</a>'
borenet 2013/07/30 13:00:33 Do we need HTML here? AFAIK the output of this sc
benchen 2013/07/30 14:34:34 Thanks Eric. I tried to open a bench logs file wit
borenet 2013/07/30 14:47:45 SGTM
408 exception = 'Bench %s value %s out of range [%s, %s].%s' % (
409 bench_platform_key, this_bench_value, this_min, this_max,
410 link)
411 exceptions.append(exception)
394 if exceptions: 412 if exceptions:
395 raise Exception('Bench values out of range:\n' + 413 raise Exception('Bench values out of range:\n' +
396 '\n'.join(exceptions)) 414 '\n'.join(exceptions))
397 415
398 def write_to_appengine(line_data_dict, url, newest_revision, bot): 416 def write_to_appengine(line_data_dict, url, newest_revision, bot):
399 """Writes latest bench values to appengine datastore. 417 """Writes latest bench values to appengine datastore.
400 line_data_dict: dictionary from create_lines. 418 line_data_dict: dictionary from create_lines.
401 url: the appengine url used to send bench values to write 419 url: the appengine url used to send bench values to write
402 newest_revision: the latest revision that this script reads 420 newest_revision: the latest revision that this script reads
403 bot: the bot platform the bench is run on 421 bot: the bot platform the bench is run on
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 print '<a id="rev_link" xlink:href="" target="_top">' 1056 print '<a id="rev_link" xlink:href="" target="_top">'
1039 print '<text id="revision" x="0" y=%s style="' % qa(font_size*2) 1057 print '<text id="revision" x="0" y=%s style="' % qa(font_size*2)
1040 print 'font-size: %s; ' % qe(font_size) 1058 print 'font-size: %s; ' % qe(font_size)
1041 print 'stroke: #0000dd; text-decoration: underline; ' 1059 print 'stroke: #0000dd; text-decoration: underline; '
1042 print '"> </text></a>' 1060 print '"> </text></a>'
1043 1061
1044 print '</svg>' 1062 print '</svg>'
1045 1063
1046 if __name__ == "__main__": 1064 if __name__ == "__main__":
1047 main() 1065 main()
OLDNEW
« 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