Skip to content

Commit 20c2b8c

Browse files
committed
refactor: remove metrics emiting from ab_test.py
There is no reason to emit metrics when running the A/B script. This is also the last peice imported from test framework, so remove the hack used to be able to import things from it. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent d0e7edf commit 20c2b8c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

tools/ab_test.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,12 @@
2222
import os
2323
import statistics
2424
import subprocess
25-
import sys
2625
from collections import defaultdict
2726
from pathlib import Path
2827
from typing import Callable, List, TypeVar
2928

3029
import scipy
3130

32-
# Hack to be able to use our test framework code
33-
sys.path.append(str(Path(__file__).parent.parent / "tests"))
34-
35-
# pylint:disable=wrong-import-position
36-
from framework.properties import global_props
37-
from host_tools.metrics import get_metrics_logger
38-
3931
UNIT_REDUCTIONS = {
4032
"Microseconds": "Milliseconds",
4133
"Milliseconds": "Seconds",
@@ -264,11 +256,6 @@ def analyze_data(
264256

265257
results = {}
266258

267-
metrics_logger = get_metrics_logger()
268-
269-
for prop_name, prop_val in global_props.__dict__.items():
270-
metrics_logger.set_property(prop_name, prop_val)
271-
272259
for dimension_set in data_a:
273260
metrics_a = data_a[dimension_set]
274261
metrics_b = data_b[dimension_set]
@@ -281,14 +268,6 @@ def analyze_data(
281268
result = check_regression(
282269
values_a, metrics_b[metric][0], n_resamples=n_resamples
283270
)
284-
285-
metrics_logger.set_dimensions({"metric": metric, **dict(dimension_set)})
286-
metrics_logger.put_metric("p_value", float(result.pvalue), "None")
287-
metrics_logger.put_metric("mean_difference", float(result.statistic), unit)
288-
metrics_logger.set_property("data_a", values_a)
289-
metrics_logger.set_property("data_b", metrics_b[metric][0])
290-
metrics_logger.flush()
291-
292271
results[dimension_set, metric] = (result, unit)
293272

294273
# We sort our A/B-Testing results keyed by metric here. The resulting lists of values

0 commit comments

Comments
 (0)