| OLD | NEW |
| 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 | 5 |
| 6 """A tool that uploads data to the performance dashboard.""" | 6 """A tool that uploads data to the performance dashboard. |
| 7 |
| 8 By default the script uploads to a local testing dashboard assumed to be running |
| 9 on the host. To run such server, check out Catapult and follow instructions at |
| 10 https://github.com/catapult-project/catapult/blob/master/dashboard/README.md . |
| 11 """ |
| 7 | 12 |
| 8 import argparse | 13 import argparse |
| 9 import httplib | 14 import httplib |
| 10 import json | 15 import json |
| 11 import pprint | 16 import pprint |
| 12 import re | 17 import re |
| 13 import sys | 18 import sys |
| 14 import urllib | 19 import urllib |
| 15 import urllib2 | 20 import urllib2 |
| 16 | 21 |
| 17 # TODO(yzshen): The following are missing currently: | 22 # TODO(yzshen): The following are missing currently: |
| 18 # (1) CL range on the dashboard; | 23 # (1) CL range on the dashboard; |
| 19 # (2) improvement direction on the dashboard; | 24 # (2) improvement direction on the dashboard; |
| 20 # (3) a link from the build step pointing to the dashboard page. | 25 # (3) a link from the build step pointing to the dashboard page. |
| 21 | 26 |
| 22 | 27 |
| 23 _PERF_LINE_FORMAT = r"""^\s*([^\s/]+) # chart name | 28 _PERF_LINE_FORMAT = r"""^\s*([^\s/]+) # chart name |
| 24 (/([^\s/]+))? # trace name (optional, separated with | 29 (/([^\s/]+))? # trace name (optional, separated with |
| 25 # the chart name by a '/') | 30 # the chart name by a '/') |
| 26 \s+(\S+) # value | 31 \s+(\S+) # value |
| 27 \s+(\S+) # units | 32 \s+(\S+) # units |
| 28 \s*$""" | 33 \s*$""" |
| 29 | 34 |
| 30 _PRODUCTION_SERVER = "https://chromeperf.appspot.com" | 35 _PRODUCTION_SERVER = "https://chromeperf.appspot.com" |
| 31 _TESTING_SERVER = "https://chrome-perf.googleplex.com" | 36 _TESTING_SERVER = "http://127.0.0.1:8080" |
| 32 | 37 |
| 33 | 38 |
| 34 def UploadPerfData(master_name, perf_id, test_name, builder_name, build_number, | 39 def UploadPerfData(master_name, perf_id, test_name, builder_name, build_number, |
| 35 revision, perf_data, point_id, dry_run=False, | 40 revision, perf_data, point_id, dry_run=False, |
| 36 testing_dashboard=True): | 41 testing_dashboard=True): |
| 37 """Uploads perf data. | 42 """Uploads perf data. |
| 38 | 43 |
| 39 Args: | 44 Args: |
| 40 Please see the help for command-line args. | 45 Please see the help for command-line args. |
| 41 | 46 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 196 |
| 192 result = UploadPerfData(args.master_name, args.perf_id, args.test_name, | 197 result = UploadPerfData(args.master_name, args.perf_id, args.test_name, |
| 193 args.builder_name, args.build_number, args.revision, | 198 args.builder_name, args.build_number, args.revision, |
| 194 args.perf_data, args.point_id, args.dry_run, | 199 args.perf_data, args.point_id, args.dry_run, |
| 195 args.testing_dashboard) | 200 args.testing_dashboard) |
| 196 return 0 if result else 1 | 201 return 0 if result else 1 |
| 197 | 202 |
| 198 | 203 |
| 199 if __name__ == '__main__': | 204 if __name__ == '__main__': |
| 200 sys.exit(main()) | 205 sys.exit(main()) |
| OLD | NEW |