Skip to content

Commit fbd0aa1

Browse files
committed
test(ab): allow dimensions to be split into multiple lists
When using metrics.put_dimensions from python code, then the resulting EMF messages will have a list of lists in their "Dimensions" key. Currently, ab_test.py assumes that this list of lists always has length one, meaning it ignores additional dimensions added via put_dimensions. Have it instead flatten the list of lists so that it always considers all dimensions. Signed-off-by: Patrick Roy <[email protected]>
1 parent 1461e28 commit fbd0aa1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/ab_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ def extract_dimensions(emf):
6464
# Skipped tests emit a duration metric, but have no dimensions set
6565
return {}
6666

67-
dimension_list = emf["_aws"]["CloudWatchMetrics"][0]["Dimensions"][0]
67+
dimension_list = [
68+
dim
69+
for dimensions in emf["_aws"]["CloudWatchMetrics"][0]["Dimensions"]
70+
for dim in dimensions
71+
]
6872
return {key: emf[key] for key in emf if key in dimension_list}
6973

7074

0 commit comments

Comments
 (0)