OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 | 5 |
6 """Functions for adding results to perf dashboard.""" | 6 """Functions for adding results to perf dashboard.""" |
7 | 7 |
8 import calendar | 8 import calendar |
9 import datetime | 9 import datetime |
10 import httplib | 10 import httplib |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 bot: A string which comes from perf_id, e.g. linux-release. | 229 bot: A string which comes from perf_id, e.g. linux-release. |
230 buildername: Builder name (for stdio links). | 230 buildername: Builder name (for stdio links). |
231 buildnumber: Build number (for stdio links). | 231 buildnumber: Build number (for stdio links). |
232 supplemental_dict: A dictionary of extra data to send with a point; | 232 supplemental_dict: A dictionary of extra data to send with a point; |
233 this includes revisions and annotation data. | 233 this includes revisions and annotation data. |
234 is_ref: True if this is a reference build, False otherwise. | 234 is_ref: True if this is a reference build, False otherwise. |
235 | 235 |
236 Returns: | 236 Returns: |
237 A dictionary in the format accepted by the perf dashboard. | 237 A dictionary in the format accepted by the perf dashboard. |
238 """ | 238 """ |
239 print "1" | |
Ken Russell (switch to Gerrit)
2016/09/30 21:45:32
Remove debugging prints -- unless you really meant
eyaich1
2016/10/03 13:32:56
Done.
| |
239 if not chart_json: | 240 if not chart_json: |
240 print 'Error: No json output from telemetry.' | 241 print 'Error: No json output from telemetry.' |
241 print '@@@STEP_FAILURE@@@' | 242 print '@@@STEP_FAILURE@@@' |
242 | 243 |
243 # The master name used for the dashboard is the CamelCase name returned by | 244 # The master name used for the dashboard is the CamelCase name returned by |
244 # GetActiveMaster(), and not the canonical master name with dots. | 245 # GetActiveMaster(), and not the canonical master name with dots. |
245 master = slave_utils.GetActiveMaster() | 246 master = slave_utils.GetActiveMaster() |
246 point_id, versions = _RevisionNumberColumns(revision_dict, prefix='') | 247 point_id, versions = _RevisionNumberColumns(revision_dict, prefix='') |
247 | 248 |
249 print "2" | |
248 supplemental = {} | 250 supplemental = {} |
249 for key in supplemental_dict: | 251 for key in supplemental_dict: |
250 if key.startswith('r_'): | 252 if key.startswith('r_'): |
251 versions[key.replace('r_', '', 1)] = supplemental_dict[key] | 253 versions[key.replace('r_', '', 1)] = supplemental_dict[key] |
252 if key.startswith('a_'): | 254 if key.startswith('a_'): |
253 supplemental[key.replace('a_', '', 1)] = supplemental_dict[key] | 255 supplemental[key.replace('a_', '', 1)] = supplemental_dict[key] |
254 | 256 |
257 print "3" | |
255 supplemental.update( | 258 supplemental.update( |
256 _GetStdioUriColumn(test_name, buildername, buildnumber)) | 259 _GetStdioUriColumn(test_name, buildername, buildnumber)) |
257 | 260 |
258 # TODO(sullivan): The android recipe sends "test_name.reference" | 261 # TODO(sullivan): The android recipe sends "test_name.reference" |
259 # while the desktop one just sends "test_name" for ref builds. Need | 262 # while the desktop one just sends "test_name" for ref builds. Need |
260 # to figure out why. | 263 # to figure out why. |
261 # https://github.com/catapult-project/catapult/issues/2046 | 264 # https://github.com/catapult-project/catapult/issues/2046 |
262 test_name = test_name.replace('.reference', '') | 265 test_name = test_name.replace('.reference', '') |
263 | 266 |
267 print "4" | |
264 fields = { | 268 fields = { |
265 'master': master, | 269 'master': master, |
266 'bot': bot, | 270 'bot': bot, |
267 'test_suite_name': test_name, | 271 'test_suite_name': test_name, |
268 'point_id': point_id, | 272 'point_id': point_id, |
269 'supplemental': supplemental, | 273 'supplemental': supplemental, |
270 'versions': versions, | 274 'versions': versions, |
271 'chart_data': chart_json, | 275 'chart_data': chart_json, |
272 'is_ref': is_ref, | 276 'is_ref': is_ref, |
273 } | 277 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 master, bot, test, revision = ( | 430 master, bot, test, revision = ( |
427 data[0]['master'], data[0]['bot'], data[0]['test'], data[0]['revision']) | 431 data[0]['master'], data[0]['bot'], data[0]['test'], data[0]['revision']) |
428 else: | 432 else: |
429 master, bot, test, revision = ( | 433 master, bot, test, revision = ( |
430 data['master'], data['bot'], data['chart_data']['benchmark_name'], | 434 data['master'], data['bot'], data['chart_data']['benchmark_name'], |
431 data['point_id']) | 435 data['point_id']) |
432 results_link = url + RESULTS_LINK_PATH % ( | 436 results_link = url + RESULTS_LINK_PATH % ( |
433 urllib.quote(master), urllib.quote(bot), urllib.quote(test.split('/')[0]), | 437 urllib.quote(master), urllib.quote(bot), urllib.quote(test.split('/')[0]), |
434 revision) | 438 revision) |
435 return '@@@STEP_LINK@%s@%s@@@' % ('Results Dashboard', results_link) | 439 return '@@@STEP_LINK@%s@%s@@@' % ('Results Dashboard', results_link) |
OLD | NEW |