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

Side by Side Diff: scripts/slave/telemetry_utils.py

Issue 745463003: Display telemetry chartjson output and result data on waterfall. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 # pylint: disable=R0201 5 # pylint: disable=R0201
6 6
7 """Log parsing for telemetry tests. 7 """Log parsing for telemetry tests.
8 8
9 The TelemetryResultsProcessor loads and contains results that were output in 9 The TelemetryResultsProcessor loads and contains results that were output in
10 JSON format from Telemetry. It can be used as a replacement for the classes in 10 JSON format from Telemetry. It can be used as a replacement for the classes in
11 the performance_log_processor module. 11 the performance_log_processor module.
12 """ 12 """
13 13
14 import json 14 import json
15 import logging 15 import logging
16 import os 16 import os
17 17
18 from slave.performance_log_processor import _FormatHumanReadable
19
20
18 class TelemetryResultsProcessor(object): 21 class TelemetryResultsProcessor(object):
19 22
20 def __init__(self, filename, is_ref): 23 def __init__(self, filename, is_ref):
21 self._chart_filename = filename 24 self._chart_filename = filename
22 self._is_reference_build = is_ref 25 self._is_reference_build = is_ref
23 26
24 def ChartJson(self): 27 def ChartJson(self):
25 try: 28 try:
26 return json.load(open(self._chart_filename)) 29 return json.load(open(self._chart_filename))
27 except (IOError, ValueError): 30 except (IOError, ValueError):
(...skipping 26 matching lines...) Expand all
54 def FailedTests(self): 57 def FailedTests(self):
55 return [] 58 return []
56 59
57 def SuppressionHashes(self): # pylint: disable=R0201 60 def SuppressionHashes(self): # pylint: disable=R0201
58 return [] 61 return []
59 62
60 def ParsingErrors(self): # pylint: disable=R0201 63 def ParsingErrors(self): # pylint: disable=R0201
61 return [] 64 return []
62 65
63 def PerformanceSummary(self): 66 def PerformanceSummary(self):
64 return '' 67 """Writes the waterfall display text.
68
69 The waterfall contains lines for each important trace, in the form
70 tracename: value< (refvalue)>
71 """
72 if self._is_reference_build:
73 return []
74
75 results = []
76 for chart_name, chart_values in self.ChartJson()['charts'].iteritems():
77 if 'summary' in chart_values:
78 summary = chart_values['summary']
shatch 2014/11/21 17:21:48 Are we only displaying summary results? This mostl
sullivan 2014/11/21 17:30:52 I think displaying summary results is fine.
79 if summary['important']:
80 mean = sum(summary['values']) / float(len(summary['values']))
81 display = '%s: %s' % (chart_name, _FormatHumanReadable(mean))
82 results.append(display)
83 return results
OLDNEW
« scripts/slave/recipe_modules/chromium/api.py ('K') | « scripts/slave/runtest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698