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

Unified Diff: chrome/test/functional/perf/endure_result_parser.py

Issue 10961012: Dump JSON data for stacked graphs in endure_result_parser.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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: chrome/test/functional/perf/endure_result_parser.py
diff --git a/chrome/test/functional/perf/endure_result_parser.py b/chrome/test/functional/perf/endure_result_parser.py
index b93b1dc1fa24ab5f1477a12ef8bdf952c2421ed8..9bad97be91a1e801b9bd1a19c065dd07169d267a 100755
--- a/chrome/test/functional/perf/endure_result_parser.py
+++ b/chrome/test/functional/perf/endure_result_parser.py
@@ -118,7 +118,8 @@ def WriteToDataFile(new_line, existing_lines, revision, data_file):
os.chmod(data_file, 0755)
-def OutputPerfData(revision, graph_name, values, units, units_x, dest_dir):
+def OutputPerfData(revision, graph_name, values, units, units_x, dest_dir,
+ is_stacked=False, stack_order=[]):
"""Outputs perf data to a local text file to be graphed.
Args:
@@ -131,6 +132,9 @@ def OutputPerfData(revision, graph_name, values, units, units_x, dest_dir):
units_x: The string description for the x-axis units on the graph. Should
be set to None if the results are not for long-running graphs.
dest_dir: The name of the destination directory to which to write.
+ is_stacked: True to draw a "stacked" graph. First-come values are
+ stacked at bottom by default.
+ stack_order: A list that contains order to stack values in the graph.
dennis_jeffrey 2012/09/26 00:58:06 is this an array of perf key strings? If so, mayb
Dai Mikurube (NOT FULLTIME) 2012/09/26 06:11:15 Done.
"""
# Update graphs.dat, which contains metadata associated with each graph.
existing_graphs = []
@@ -179,6 +183,9 @@ def OutputPerfData(revision, graph_name, values, units, units_x, dest_dir):
'traces': new_traces,
'rev': revision
}
+ if is_stacked:
+ new_line['stack'] = is_stacked
dennis_jeffrey 2012/09/26 00:58:06 since we will only include 'stack' in the line if
Dai Mikurube (NOT FULLTIME) 2012/09/26 06:11:15 Done.
+ new_line['stack_order'] = stack_order
WriteToDataFile(new_line, existing_lines, revision, data_file)
@@ -228,7 +235,7 @@ def UpdatePerfDataFromFetchedContent(revision, content, webapp_name, test_name):
perf_data_raw = []
def AppendRawPerfData(graph_name, description, value, units, units_x,
- webapp_name, test_name):
+ webapp_name, test_name, is_stacked=False):
perf_data_raw.append({
'graph_name': graph_name,
'description': description,
@@ -237,6 +244,7 @@ def UpdatePerfDataFromFetchedContent(revision, content, webapp_name, test_name):
'units_x': units_x,
'webapp_name': webapp_name,
'test_name': test_name,
+ 'stack': is_stacked,
})
# First scan for short-running perf test results.
@@ -249,7 +257,7 @@ def UpdatePerfDataFromFetchedContent(revision, content, webapp_name, test_name):
for match in re.findall(
r'RESULT ([^:]+): ([^=]+)= (\[[^\]]+\]) (\S+) (\S+)', content):
AppendRawPerfData(match[0], match[1], eval(match[2]), match[3], match[4],
- webapp_name, test_name)
+ webapp_name, test_name, match[0].endswith('-DMP'))
Dai Mikurube (NOT FULLTIME) 2012/09/20 09:17:30 It's temporary. We need to decide "RESULT" protoc
dennis_jeffrey 2012/09/26 00:58:06 I think this is ok for now, since we append "-DMP"
Dai Mikurube (NOT FULLTIME) 2012/09/26 06:11:15 Done.
# Next scan for events in the test results.
for match in re.findall(
@@ -274,6 +282,12 @@ def UpdatePerfDataFromFetchedContent(revision, content, webapp_name, test_name):
'webapp_name': data['webapp_name'],
'test_name': data['test_name'],
}
+ perf_data[key1]['stack'] = data['stack']
+ if 'stack_order' not in perf_data[key1]:
+ perf_data[key1]['stack_order'] = []
+ if data['description'] not in perf_data[key1]['stack_order']:
+ perf_data[key1]['stack_order'].append(data['description'])
dennis_jeffrey 2012/09/26 00:58:06 should we only execute lines 286-289 if data['stac
Dai Mikurube (NOT FULLTIME) 2012/09/26 06:11:15 I did it to simplify line 321 (calling OutputPerfD
+
if data['graph_name'] != '_EVENT_' and not data['units_x']:
# Short-running test result.
perf_data[key1]['value'][key2] = data['value']
@@ -303,7 +317,8 @@ def UpdatePerfDataFromFetchedContent(revision, content, webapp_name, test_name):
OutputPerfData(revision, perf_data_dict['graph_name'],
perf_data_dict['value'],
perf_data_dict['units'], perf_data_dict['units_x'],
- dest_dir)
+ dest_dir,
+ perf_data_dict['stack'], perf_data_dict['stack_order'])
def UpdatePerfDataForSlaveAndBuild(slave_info, build_num):
« 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