diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseCPUMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/BaseCPUMeasurement.py index 00ad5487..f9fd74b8 100644 --- a/lnst/RecipeCommon/Perf/Measurements/BaseCPUMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/BaseCPUMeasurement.py @@ -1,4 +1,4 @@ -from lnst.Controller.RecipeResults import MeasurementResult +from lnst.Controller.RecipeResults import MeasurementResult, ResultType from lnst.RecipeCommon.Perf.Measurements.MeasurementError import MeasurementError from lnst.RecipeCommon.Perf.Measurements.BaseMeasurement import BaseMeasurement from lnst.RecipeCommon.Perf.Measurements.Results import AggregatedCPUMeasurementResults @@ -38,7 +38,18 @@ def _report_host_results(cls, recipe, results): desc = [result.describe() for result in results] - recipe.add_custom_result(MeasurementResult("cpu", description="\n".join(desc), data=cpu_data)) + recipe.add_custom_result( + MeasurementResult( + "cpu", + result=( + ResultType.PASS + if results.measurement_success + else ResultType.FAIL + ), + description="\n".join(desc), + data=cpu_data, + ) + ) def _aggregate_hostcpu_results(self, old, new): if (old is not None and diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py index 3b95465d..81354e3f 100644 --- a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py @@ -97,18 +97,19 @@ def _report_flow_results(cls, recipe, flow_results): desc = [] desc.append(flow_results.describe()) - recipe_result = ResultType.PASS metrics = {"Generator": generator, "Generator process": generator_cpu, "Receiver": receiver, "Receiver process": receiver_cpu} for name, result in metrics.items(): if cls._invalid_flow_duration(result): - recipe_result = ResultType.FAIL desc.append("{} has invalid duration!".format(name)) # TODO add flow description recipe_result = MeasurementResult( "flow", description="\n".join(desc), + result=( + ResultType.PASS if flow_results.measurement_success else ResultType.FAIL + ), data={ "generator_flow_data": generator, "generator_cpu_data": generator_cpu, diff --git a/lnst/RecipeCommon/Perf/Measurements/RDMABandwidthMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/RDMABandwidthMeasurement.py index 6683f557..792e8a36 100644 --- a/lnst/RecipeCommon/Perf/Measurements/RDMABandwidthMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/RDMABandwidthMeasurement.py @@ -4,7 +4,7 @@ from lnst.Controller.Job import Job from lnst.Controller.Recipe import BaseRecipe -from lnst.Controller.RecipeResults import MeasurementResult +from lnst.Controller.RecipeResults import MeasurementResult, ResultType from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import Flow, NetworkFlowTest from lnst.RecipeCommon.Perf.Results import PerfInterval from lnst.Tests.RDMABandwidth import RDMABandwidthServer, RDMABandwidthClient @@ -159,6 +159,11 @@ def report_results( for aggregated_result in aggregated_results: measurement_result = MeasurementResult( "rdma-bandwidth", + result=( + ResultType.PASS + if aggregated_result.measurement_success + else ResultType.FAIL + ), description=aggregated_result.describe(), data={"bandwidth": aggregated_result.bandwidth} ) diff --git a/lnst/RecipeCommon/Perf/Measurements/TcRunMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/TcRunMeasurement.py index 98b22933..12559941 100644 --- a/lnst/RecipeCommon/Perf/Measurements/TcRunMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/TcRunMeasurement.py @@ -248,9 +248,10 @@ def report_results(cls, recipe: BaseRecipe, results: list[TcRunMeasurementResult @classmethod def _report_result(cls, recipe: BaseRecipe, result: TcRunMeasurementResults): - r_type = ResultType.PASS if result.run_success else ResultType.FAIL + r_type = ResultType.PASS if result.measurement_success else ResultType.FAIL measurement_result = MeasurementResult( "tc", + result=r_type, description=f"{r_type} {result.description}", data={"rule_install_rate": result.rule_install_rate}, ) diff --git a/lnst/RecipeCommon/Perf/Measurements/XDPBenchMeasurement.py b/lnst/RecipeCommon/Perf/Measurements/XDPBenchMeasurement.py index 74802c18..64c76275 100644 --- a/lnst/RecipeCommon/Perf/Measurements/XDPBenchMeasurement.py +++ b/lnst/RecipeCommon/Perf/Measurements/XDPBenchMeasurement.py @@ -22,7 +22,7 @@ from lnst.Tests.PktGen import PktGen from lnst.Tests.XDPBench import XDPBench from lnst.Controller.Job import Job -from lnst.Controller.RecipeResults import MeasurementResult +from lnst.Controller.RecipeResults import MeasurementResult, ResultType from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement @@ -225,6 +225,11 @@ def report_results(cls, recipe: BaseRecipe, results: list[AggregatedXDPBenchMeas recipe_result = MeasurementResult( "xdp-bench", + result=( + ResultType.PASS + if result.measurement_success + else ResultType.FAIL + ), description="\n".join(desc), data={ "generator_results": generator,