|
12 | 12 | import logging |
13 | 13 | import re |
14 | 14 |
|
| 15 | +import boto3 |
15 | 16 | import pytest |
16 | 17 | from assertpy import assert_that |
17 | 18 | from remote_command_executor import RemoteCommandExecutor |
|
20 | 21 | from tests.common.assertions import assert_no_errors_in_logs |
21 | 22 | from tests.common.mpi_common import _test_mpi |
22 | 23 | from tests.common.osu_common import run_individual_osu_benchmark |
23 | | -from tests.common.utils import fetch_instance_slots, run_system_analyzer |
| 24 | +from tests.common.utils import fetch_instance_slots, get_installed_parallelcluster_version, run_system_analyzer |
24 | 25 |
|
25 | 26 |
|
26 | 27 | @pytest.mark.usefixtures("serial_execution_by_instance") |
@@ -244,6 +245,8 @@ def _check_osu_benchmarks_results(test_datadir, instance, mpi_version, benchmark |
244 | 245 | logging.info(output) |
245 | 246 | # Check avg latency for all packet sizes |
246 | 247 | failures = 0 |
| 248 | + metric_data = [] |
| 249 | + metric_namespace = "ParallelCluster/test_efa" |
247 | 250 | for packet_size, value in re.findall(r"(\d+)\s+(\d+)\.", output): |
248 | 251 | with open( |
249 | 252 | str(test_datadir / "osu_benchmarks" / "results" / instance / mpi_version / benchmark_name), encoding="utf-8" |
@@ -271,11 +274,28 @@ def _check_osu_benchmarks_results(test_datadir, instance, mpi_version, benchmark |
271 | 274 | f"tolerated: {tolerated_value}, current: {value}" |
272 | 275 | ) |
273 | 276 |
|
| 277 | + dimensions = { |
| 278 | + "PclusterVersion": get_installed_parallelcluster_version(), |
| 279 | + "MpiVariant": mpi_version, |
| 280 | + "Instance": instance, |
| 281 | + "OsuBenchmarkName": benchmark_name, |
| 282 | + "PacketSize": packet_size, |
| 283 | + } |
| 284 | + metric_data.append( |
| 285 | + { |
| 286 | + "MetricName": "Latency", |
| 287 | + "Dimensions": [{"Name": name, "Value": str(value)} for name, value in dimensions.items()], |
| 288 | + "Value": int(value), |
| 289 | + "Unit": "Microseconds", |
| 290 | + } |
| 291 | + ) |
| 292 | + |
274 | 293 | if is_failure: |
275 | 294 | failures = failures + 1 |
276 | 295 | logging.error(message) |
277 | 296 | else: |
278 | 297 | logging.info(message) |
| 298 | + boto3.client("cloudwatch").put_metric_data(Namespace=metric_namespace, MetricData=metric_data) |
279 | 299 |
|
280 | 300 | return failures |
281 | 301 |
|
|
0 commit comments