Chromium Code Reviews| 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 """Performance Test Bisect Tool | 6 """Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script bisects a series of changelists using binary search. It starts at | 8 This script bisects a series of changelists using binary search. It starts at |
| 9 a bad revision where a performance metric has regressed, and asks for a last | 9 a bad revision where a performance metric has regressed, and asks for a last |
| 10 known-good revision. It will then binary search across this revision range by | 10 known-good revision. It will then binary search across this revision range by |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 import shutil | 43 import shutil |
| 44 import StringIO | 44 import StringIO |
| 45 import sys | 45 import sys |
| 46 import time | 46 import time |
| 47 import zipfile | 47 import zipfile |
| 48 | 48 |
| 49 sys.path.append(os.path.join( | 49 sys.path.append(os.path.join( |
| 50 os.path.dirname(__file__), os.path.pardir, 'telemetry')) | 50 os.path.dirname(__file__), os.path.pardir, 'telemetry')) |
| 51 | 51 |
| 52 from bisect_results import BisectResults | 52 from bisect_results import BisectResults |
| 53 from bisect_results import ConfidenceScore | |
| 53 import bisect_utils | 54 import bisect_utils |
| 54 import builder | 55 import builder |
| 55 import math_utils | 56 import math_utils |
| 56 import request_build | 57 import request_build |
| 57 import source_control as source_control_module | 58 import source_control as source_control_module |
| 58 from telemetry.util import cloud_storage | 59 from telemetry.util import cloud_storage |
| 59 | 60 |
| 60 # Below is the map of "depot" names to information about each depot. Each depot | 61 # Below is the map of "depot" names to information about each depot. Each depot |
| 61 # is a repository, and in the process of bisecting, revision ranges in these | 62 # is a repository, and in the process of bisecting, revision ranges in these |
| 62 # repositories may also be bisected. | 63 # repositories may also be bisected. |
| (...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2438 'a working \'good\' revision to start from.\n\nError: %s' % | 2439 'a working \'good\' revision to start from.\n\nError: %s' % |
| 2439 good_results[0]) | 2440 good_results[0]) |
| 2440 return results | 2441 return results |
| 2441 | 2442 |
| 2442 | 2443 |
| 2443 # We need these reference values to determine if later runs should be | 2444 # We need these reference values to determine if later runs should be |
| 2444 # classified as pass or fail. | 2445 # classified as pass or fail. |
| 2445 known_bad_value = bad_results[0] | 2446 known_bad_value = bad_results[0] |
| 2446 known_good_value = good_results[0] | 2447 known_good_value = good_results[0] |
| 2447 | 2448 |
| 2449 regression_confidence = ConfidenceScore(known_bad_value['values'], | |
| 2450 known_good_value['values']) | |
| 2451 if regression_confidence < HIGH_CONFIDENCE: | |
|
qyearsley
2014/10/12 04:07:21
I'm not 100% sure it's good practice to re-use the
RobertoCN
2014/10/17 22:44:37
Done.
| |
| 2452 results.error = ('The results of the performance test on the \'good\' ' | |
| 2453 'and \'bad\' revisions are so close together that we ' | |
| 2454 'can\'t be confident this is a regression. Try ' | |
| 2455 'bisecting a different revision range.') | |
|
qyearsley
2014/10/12 04:07:22
I think that this message can be improved. We want
RobertoCN
2014/10/17 22:44:37
Done.
qyearsley
2014/10/17 23:53:52
Sometimes when the bisect can't reproduce the regr
| |
| 2456 return results | |
| 2448 # Can just mark the good and bad revisions explicitly here since we | 2457 # Can just mark the good and bad revisions explicitly here since we |
| 2449 # already know the results. | 2458 # already know the results. |
| 2450 bad_revision_data = revision_data[revision_list[0]] | 2459 bad_revision_data = revision_data[revision_list[0]] |
| 2451 bad_revision_data['external'] = bad_results[2] | 2460 bad_revision_data['external'] = bad_results[2] |
| 2452 bad_revision_data['perf_time'] = bad_results[3] | 2461 bad_revision_data['perf_time'] = bad_results[3] |
| 2453 bad_revision_data['build_time'] = bad_results[4] | 2462 bad_revision_data['build_time'] = bad_results[4] |
| 2454 bad_revision_data['passed'] = False | 2463 bad_revision_data['passed'] = False |
| 2455 bad_revision_data['value'] = known_bad_value | 2464 bad_revision_data['value'] = known_bad_value |
| 2456 | 2465 |
| 2457 good_revision_data = revision_data[revision_list[max_revision]] | 2466 good_revision_data = revision_data[revision_list[max_revision]] |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3257 # bugs. If you change this, please update the perf dashboard as well. | 3266 # bugs. If you change this, please update the perf dashboard as well. |
| 3258 bisect_utils.OutputAnnotationStepStart('Results') | 3267 bisect_utils.OutputAnnotationStepStart('Results') |
| 3259 print 'Error: %s' % e.message | 3268 print 'Error: %s' % e.message |
| 3260 if opts.output_buildbot_annotations: | 3269 if opts.output_buildbot_annotations: |
| 3261 bisect_utils.OutputAnnotationStepClosed() | 3270 bisect_utils.OutputAnnotationStepClosed() |
| 3262 return 1 | 3271 return 1 |
| 3263 | 3272 |
| 3264 | 3273 |
| 3265 if __name__ == '__main__': | 3274 if __name__ == '__main__': |
| 3266 sys.exit(main()) | 3275 sys.exit(main()) |
| OLD | NEW |