-
Notifications
You must be signed in to change notification settings - Fork 223
Add UnifiedMessage support for NetworkUDPPerformanceMessage in iperf3 #4059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
31e530b
1932c7d
af83f2e
9ee7ea2
bf05093
40037b8
e6fb706
5e58cd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,9 +10,12 @@ | |
|
|
||
| from lisa.executable import Tool | ||
| from lisa.messages import ( | ||
| MetricRelativity, | ||
| NetworkTCPPerformanceMessage, | ||
| NetworkUDPPerformanceMessage, | ||
| TransportProtocol, | ||
| create_perf_message, | ||
| send_unified_perf_message, | ||
| ) | ||
| from lisa.operating_system import Posix | ||
| from lisa.tools import Cat | ||
|
|
@@ -427,6 +430,18 @@ def create_iperf_udp_performance_message( | |
| ) | ||
| other_fields["send_buffer_size"] = Decimal(buffer_length) | ||
| other_fields["connections_num"] = connections_num | ||
|
|
||
| # Send unified performance messages | ||
| self.send_iperf_udp_unified_perf_messages( | ||
| tx_throughput_in_gbps=other_fields["tx_throughput_in_gbps"], | ||
| rx_throughput_in_gbps=other_fields["rx_throughput_in_gbps"], | ||
| data_loss=other_fields["data_loss"], | ||
| send_buffer_size=other_fields["send_buffer_size"], | ||
| connections_num=connections_num, | ||
| test_case_name=test_case_name, | ||
| test_result=test_result, | ||
| ) | ||
|
|
||
| return create_perf_message( | ||
| NetworkUDPPerformanceMessage, | ||
| self.node, | ||
|
|
@@ -435,6 +450,73 @@ def create_iperf_udp_performance_message( | |
| other_fields, | ||
| ) | ||
|
|
||
| def send_iperf_udp_unified_perf_messages( | ||
| self, | ||
| tx_throughput_in_gbps: Decimal, | ||
| rx_throughput_in_gbps: Decimal, | ||
| data_loss: Decimal, | ||
| send_buffer_size: Decimal, | ||
| connections_num: int, | ||
| test_case_name: str, | ||
| test_result: "TestResult", | ||
| ) -> None: | ||
| """Send unified performance messages for UDP iperf3 metrics.""" | ||
| # Send connections_num as a Parameter type metric | ||
| send_unified_perf_message( | ||
| node=self.node, | ||
| test_result=test_result, | ||
| test_case_name=test_case_name, | ||
| tool=constants.NETWORK_PERFORMANCE_TOOL_IPERF, | ||
| metric_name="connections_num", | ||
| metric_value=float(connections_num), | ||
| metric_unit="", | ||
| metric_description="Parameter", | ||
| metric_relativity=MetricRelativity.NA, | ||
| protocol_type=TransportProtocol.Udp, | ||
| ) | ||
|
|
||
| metrics = [ | ||
| { | ||
| "name": "tx_throughput_in_gbps", | ||
| "value": float(tx_throughput_in_gbps), | ||
| "relativity": MetricRelativity.HigherIsBetter, | ||
| "unit": "Gbps", | ||
| }, | ||
| { | ||
| "name": "rx_throughput_in_gbps", | ||
| "value": float(rx_throughput_in_gbps), | ||
| "relativity": MetricRelativity.HigherIsBetter, | ||
| "unit": "Gbps", | ||
| }, | ||
| { | ||
| "name": "data_loss", | ||
| "value": float(data_loss), | ||
| "relativity": MetricRelativity.LowerIsBetter, | ||
| "unit": "%", | ||
| }, | ||
| { | ||
| "name": "send_buffer_size", | ||
| "value": float(send_buffer_size), | ||
| "relativity": MetricRelativity.NA, | ||
|
||
| "unit": "bytes", | ||
| }, | ||
| ] | ||
|
|
||
| tool = constants.NETWORK_PERFORMANCE_TOOL_IPERF | ||
|
|
||
| for metric in metrics: | ||
| send_unified_perf_message( | ||
| node=self.node, | ||
| test_result=test_result, | ||
| test_case_name=test_case_name, | ||
| tool=tool, | ||
| metric_name=metric["name"], | ||
| metric_value=metric["value"], | ||
| metric_unit=metric.get("unit", ""), | ||
| metric_relativity=metric["relativity"], | ||
| protocol_type=TransportProtocol.Udp, | ||
| ) | ||
|
|
||
| def get_sender_bandwidth(self, result: str) -> Decimal: | ||
| return self._get_bandwidth(result, self._sender_pattern) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it in the metrics array and send together. @copilot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added parameters to the metrics array. Now all parameters (connections_num, send_buffer_size) and performance metrics (tx_throughput, rx_throughput, data_loss) are in a single array and sent together in one loop. Commit: 5e58cd1