Skip to content

Commit 0a33398

Browse files
committed
Update ntttcp.py
1 parent d82f995 commit 0a33398

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

lisa/tools/ntttcp.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -667,20 +667,28 @@ def send_ntttcp_udp_unified_perf_messages(
667667
"relativity": MetricRelativity.LowerIsBetter,
668668
"unit": "cycles/byte",
669669
},
670-
{
671-
"name": "server_mtu",
672-
"value": int(server_mtu),
673-
"relativity": MetricRelativity.NA,
674-
"unit": "bytes",
675-
},
676-
{
677-
"name": "client_mtu",
678-
"value": int(client_mtu),
679-
"relativity": MetricRelativity.NA,
680-
"unit": "bytes",
681-
},
682670
]
683671

672+
# Only send MTU metrics if they are valid (not -1)
673+
if client_mtu != -1:
674+
metrics.append(
675+
{
676+
"name": f"client_mtu{conn_suffix}",
677+
"value": int(client_mtu),
678+
"relativity": MetricRelativity.NA,
679+
"unit": "bytes",
680+
}
681+
)
682+
if server_mtu != -1:
683+
metrics.append(
684+
{
685+
"name": f"server_mtu{conn_suffix}",
686+
"value": int(server_mtu),
687+
"relativity": MetricRelativity.NA,
688+
"unit": "bytes",
689+
},
690+
)
691+
684692
self._send_unified_perf_metrics(
685693
metrics, test_case_name, test_result, TransportProtocol.Udp
686694
)

0 commit comments

Comments
 (0)