Skip to content

Commit 7e048d5

Browse files
[Integ-tests] Upload OSU benchmark results to CloudWatch metric
Therefore, we will have a historical view of performance Signed-off-by: Hanwen <[email protected]>
1 parent 2a45dda commit 7e048d5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/integration-tests/tests/efa/test_efa.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import logging
1313
import re
1414

15+
import boto3
1516
import pytest
1617
from assertpy import assert_that
1718
from remote_command_executor import RemoteCommandExecutor
@@ -20,7 +21,7 @@
2021
from tests.common.assertions import assert_no_errors_in_logs
2122
from tests.common.mpi_common import _test_mpi
2223
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
2425

2526

2627
@pytest.mark.usefixtures("serial_execution_by_instance")
@@ -244,6 +245,8 @@ def _check_osu_benchmarks_results(test_datadir, instance, mpi_version, benchmark
244245
logging.info(output)
245246
# Check avg latency for all packet sizes
246247
failures = 0
248+
metric_data = []
249+
metric_namespace = "ParallelCluster/test_efa"
247250
for packet_size, value in re.findall(r"(\d+)\s+(\d+)\.", output):
248251
with open(
249252
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
271274
f"tolerated: {tolerated_value}, current: {value}"
272275
)
273276

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+
274293
if is_failure:
275294
failures = failures + 1
276295
logging.error(message)
277296
else:
278297
logging.info(message)
298+
boto3.client("cloudwatch").put_metric_data(Namespace=metric_namespace, MetricData=metric_data)
279299

280300
return failures
281301

0 commit comments

Comments
 (0)