OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import math | 5 import math |
6 import os | 6 import os |
7 | 7 |
8 import bisect_utils | 8 import bisect_utils |
9 import math_utils | 9 import math_utils |
10 import source_control | 10 import source_control |
(...skipping 20 matching lines...) Expand all Loading... |
31 regression_size: For performance bisects, this is a relative change of | 31 regression_size: For performance bisects, this is a relative change of |
32 the mean metric value. For other bisects this field always contains | 32 the mean metric value. For other bisects this field always contains |
33 'zero-to-nonzero'. | 33 'zero-to-nonzero'. |
34 regression_std_err: For performance bisects, it is a pooled standard error | 34 regression_std_err: For performance bisects, it is a pooled standard error |
35 for groups of good and bad runs. Not used for other bisects. | 35 for groups of good and bad runs. Not used for other bisects. |
36 confidence: For performance bisects, it is a confidence that the good and | 36 confidence: For performance bisects, it is a confidence that the good and |
37 bad runs are distinct groups. Not used for non-performance bisects. | 37 bad runs are distinct groups. Not used for non-performance bisects. |
38 """ | 38 """ |
39 | 39 |
40 def __init__(self, bisect_state=None, depot_registry=None, opts=None, | 40 def __init__(self, bisect_state=None, depot_registry=None, opts=None, |
41 runtime_warnings=None, error=None): | 41 runtime_warnings=None, error=None, abort_reason=None): |
42 """Computes final bisect results after a bisect run is complete. | 42 """Computes final bisect results after a bisect run is complete. |
43 | 43 |
44 This constructor should be called in one of the following ways: | 44 This constructor should be called in one of the following ways: |
45 BisectResults(state, depot_registry, opts, runtime_warnings) | 45 BisectResults(state, depot_registry, opts, runtime_warnings) |
46 BisectResults(error=error) | 46 BisectResults(error=error) |
47 | 47 |
48 First option creates an object representing successful bisect results, while | 48 First option creates an object representing successful bisect results, while |
49 second option creates an error result. | 49 second option creates an error result. |
50 | 50 |
51 Args: | 51 Args: |
52 bisect_state: BisectState object representing latest bisect state. | 52 bisect_state: BisectState object representing latest bisect state. |
53 depot_registry: DepotDirectoryRegistry object with information on each | 53 depot_registry: DepotDirectoryRegistry object with information on each |
54 repository in the bisect_state. | 54 repository in the bisect_state. |
55 opts: Options passed to the bisect run. | 55 opts: Options passed to the bisect run. |
56 runtime_warnings: A list of warnings from the bisect run. | 56 runtime_warnings: A list of warnings from the bisect run. |
57 error: Error message. When error is not None, other arguments are ignored. | 57 error: Error message. When error is not None, other arguments are ignored. |
58 """ | 58 """ |
59 | 59 |
60 self.error = error | 60 self.error = error |
61 if error is not None: | 61 self.abort_reason = abort_reason |
| 62 if error is not None or abort_reason is not None: |
62 return | 63 return |
63 | 64 |
64 assert (bisect_state is not None and depot_registry is not None and | 65 assert (bisect_state is not None and depot_registry is not None and |
65 opts is not None and runtime_warnings is not None), ( | 66 opts is not None and runtime_warnings is not None), ( |
66 'Incorrect use of the BisectResults constructor. When error is ' | 67 'Incorrect use of the BisectResults constructor. When error is ' |
67 'None, all other arguments are required') | 68 'None, all other arguments are required') |
68 | 69 |
69 self.state = bisect_state | 70 self.state = bisect_state |
70 | 71 |
71 rev_states = bisect_state.GetRevisionStates() | 72 rev_states = bisect_state.GetRevisionStates() |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 # overall graph is. | 264 # overall graph is. |
264 confidence_params = (sum(working_means, []), sum(broken_means, [])) | 265 confidence_params = (sum(working_means, []), sum(broken_means, [])) |
265 confidence = cls.ConfidenceScore(*confidence_params) | 266 confidence = cls.ConfidenceScore(*confidence_params) |
266 | 267 |
267 bad_greater_than_good = mean_of_bad_runs > mean_of_good_runs | 268 bad_greater_than_good = mean_of_bad_runs > mean_of_good_runs |
268 | 269 |
269 return {'regression_size': regression_size, | 270 return {'regression_size': regression_size, |
270 'regression_std_err': regression_std_err, | 271 'regression_std_err': regression_std_err, |
271 'confidence': confidence, | 272 'confidence': confidence, |
272 'bad_greater_than_good': bad_greater_than_good} | 273 'bad_greater_than_good': bad_greater_than_good} |
OLD | NEW |