Skip to content

Commit b9f4c6c

Browse files
bchaliosroypat
andcommitted
metrics: dump the error metrics during failure
Fix the assertion to print a more useful message when an error metric is non-zero. Also, make sure that we upload metrics to CloudWatch even when there is a non-zero error metric. Signed-off-by: Babis Chalios <[email protected]> Co-authored-by: Patrick Roy <[email protected]>
1 parent 9624ec3 commit b9f4c6c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/host_tools/fcmetrics.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
import datetime
11+
import json
1112
import math
1213
import platform
1314
import time
@@ -463,14 +464,15 @@ def flatten_dict(node, prefix: str):
463464
continue
464465
metrics.put_metric(key, value, get_emf_unit_for_fc_metrics(key))
465466

466-
assert not {
467+
metrics.flush()
468+
469+
failure_metrics = {
467470
key: value
468471
for key, value in flattened_metrics.items()
469472
if "err" in key or "fail" in key or "panic" in key or "num_faults" in key
470473
if value
471474
}
472-
473-
metrics.flush()
475+
assert not failure_metrics, json.dumps(failure_metrics, indent=1)
474476

475477

476478
class FCMetricsMonitor(Thread):

0 commit comments

Comments
 (0)