OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 collections | 5 import collections |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 | 8 |
9 from google.appengine.api import taskqueue | 9 from google.appengine.api import taskqueue |
10 from google.appengine.ext import ndb | 10 from google.appengine.ext import ndb |
11 | 11 |
12 from dashboard.common import utils | 12 from dashboard.common import utils |
13 from dashboard.pinpoint import mann_whitney_u | 13 from dashboard.pinpoint import mann_whitney_u |
14 from dashboard.pinpoint.models import attempt as attempt_module | 14 from dashboard.pinpoint.models import attempt as attempt_module |
15 from dashboard.pinpoint.models import change as change_module | 15 from dashboard.pinpoint.models import change as change_module |
16 from dashboard.services import issue_tracker_service | 16 from dashboard.services import issue_tracker_service |
17 | 17 |
18 | 18 |
19 # We want this to be fast to minimize overhead while waiting for tasks to | 19 # We want this to be fast to minimize overhead while waiting for tasks to |
20 # finish, but don't want to consume too many resources. | 20 # finish, but don't want to consume too many resources. |
21 _TASK_INTERVAL = 10 | 21 _TASK_INTERVAL = 10 |
22 | 22 |
23 | 23 |
24 _DEFAULT_REPEAT_COUNT = 10 | |
25 _DEFAULT_ATTEMPT_COUNT = 1 | 24 _DEFAULT_ATTEMPT_COUNT = 1 |
26 _SIGNIFICANCE_LEVEL = 0.01 | 25 _SIGNIFICANCE_LEVEL = 0.01 |
27 | 26 |
28 | 27 |
29 _DIFFERENT = 'different' | 28 _DIFFERENT = 'different' |
30 _PENDING = 'pending' | 29 _PENDING = 'pending' |
31 _SAME = 'same' | 30 _SAME = 'same' |
32 _UNKNOWN = 'unknown' | 31 _UNKNOWN = 'unknown' |
33 | 32 |
34 | 33 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 323 |
325 try: | 324 try: |
326 p_value = mann_whitney_u.MannWhitneyU(results_a, results_b) | 325 p_value = mann_whitney_u.MannWhitneyU(results_a, results_b) |
327 except ValueError: | 326 except ValueError: |
328 return _UNKNOWN | 327 return _UNKNOWN |
329 | 328 |
330 if p_value < _SIGNIFICANCE_LEVEL: | 329 if p_value < _SIGNIFICANCE_LEVEL: |
331 return _DIFFERENT | 330 return _DIFFERENT |
332 else: | 331 else: |
333 return _UNKNOWN | 332 return _UNKNOWN |
OLD | NEW |