File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/pytest_codspeed/instruments Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 26
26
TIMER_RESOLUTION_NS = get_clock_info ("perf_counter" ).resolution * 1e9
27
27
DEFAULT_MIN_ROUND_TIME_NS = TIMER_RESOLUTION_NS * 1_000_000
28
28
29
+ IQR_OUTLIER_FACTOR = 1.5
30
+ STDEV_OUTLIER_FACTOR = 3
31
+
29
32
30
33
@dataclass
31
34
class BenchmarkConfig :
@@ -89,12 +92,16 @@ def from_list(
89
92
)
90
93
iqr_ns = q3_ns - q1_ns
91
94
iqr_outlier_rounds = sum (
92
- 1 for t in times_ns if t < q1_ns - 1.5 * iqr_ns or t > q3_ns + 1.5 * iqr_ns
95
+ 1
96
+ for t in times_ns
97
+ if t < q1_ns - IQR_OUTLIER_FACTOR * iqr_ns
98
+ or t > q3_ns + IQR_OUTLIER_FACTOR * iqr_ns
93
99
)
94
100
stdev_outlier_rounds = sum (
95
101
1
96
102
for t in times_ns
97
- if t < mean_ns - 3 * stdev_ns or t > mean_ns + 3 * stdev_ns
103
+ if t < mean_ns - STDEV_OUTLIER_FACTOR * stdev_ns
104
+ or t > mean_ns + STDEV_OUTLIER_FACTOR * stdev_ns
98
105
)
99
106
100
107
return cls (
You can’t perform that action at this time.
0 commit comments