Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

This PR adds unified performance message support to the iperf3 tool, bringing it into alignment with the existing pattern established by ntttcp. Previously, iperf3 only sent traditional NetworkTCPPerformanceMessage and NetworkUDPPerformanceMessage, while ntttcp sent both traditional messages and unified performance messages for better analytics and standardization.

Changes Made

Core Implementation

  • Added Imports: MetricRelativity, TransportProtocol, and send_unified_perf_message to iperf3.py
  • Helper Method: _send_unified_perf_metrics() - Sends unified performance metrics following the established pattern
  • TCP Unified Messages: send_iperf3_tcp_unified_perf_messages() - Sends unified messages for TCP performance metrics
  • UDP Unified Messages: send_iperf3_udp_unified_perf_messages() - Sends unified messages for UDP performance metrics

TCP Metrics Sent

  • connections_num (Parameter) - Number of concurrent connections
  • rx_throughput_in_gbps (HigherIsBetter) - Receive throughput
  • tx_throughput_in_gbps (HigherIsBetter) - Transmit throughput
  • buffer_size_bytes (Parameter) - Buffer size configuration
  • congestion_windowsize_kb (HigherIsBetter) - TCP congestion window size
  • retransmitted_segments (LowerIsBetter) - Number of retransmitted segments

UDP Metrics Sent

  • connections_num (Parameter) - Number of concurrent connections
  • tx_throughput_in_gbps (HigherIsBetter) - Transmit throughput
  • rx_throughput_in_gbps (HigherIsBetter) - Receive throughput
  • data_loss (LowerIsBetter) - Packet loss percentage
  • send_buffer_size (Parameter) - Send buffer size configuration

Pattern Alignment with Main Branch

  • MetricRelativity.Parameter: Used for parameter-type metrics (connections_num, buffer sizes) to distinguish them from performance metrics
  • Clean Metric Names: Metric names use simple, clean identifiers without connection suffixes (e.g., rx_throughput_in_gbps instead of rx_throughput_in_gbps_conn_1)
  • Efficient Parsing: Uses already-parsed fields from other_fields to avoid redundant JSON parsing

Integration

Updated the existing message creation methods to call the unified message senders:

  • create_iperf_tcp_performance_message() now calls send_iperf3_tcp_unified_perf_messages()
  • create_iperf_udp_performance_message() now calls send_iperf3_udp_unified_perf_messages()

Benefits

  1. Consistency - iperf3 now follows the same unified message pattern as ntttcp, making performance data collection consistent across network performance tools
  2. Better Analytics - Unified messages provide standardized metrics with clear relativity indicators for automated analysis
  3. Parameter Tracking - Test parameters (connections, buffer sizes) are explicitly marked with MetricRelativity.Parameter for better data categorization
  4. Clean Metric Names - Simple metric names without embedded suffixes make data analysis and visualization easier
  5. Backward Compatible - Traditional performance messages are still sent, ensuring existing workflows continue to work

Testing

  • ✅ Code compiles without syntax errors
  • ✅ Merged with main branch to include latest MetricRelativity.Parameter enum
  • ✅ All new methods follow established patterns
  • ✅ Import statements are correct and consistent
Original prompt

Add UnifiedMessage for all NetworkTCPPerformanceMessage like other examples


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI self-assigned this Oct 20, 2025
Co-authored-by: squirrelsc <27178119+squirrelsc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add UnifiedMessage for all NetworkTCPPerformanceMessage Add UnifiedMessage support for iperf3 TCP and UDP performance metrics Oct 20, 2025
Copilot AI requested a review from squirrelsc October 20, 2025 21:52
Copilot finished work on behalf of squirrelsc October 20, 2025 21:52
…ions_num as parameter

Co-authored-by: squirrelsc <27178119+squirrelsc@users.noreply.github.com>
Copilot finished work on behalf of squirrelsc October 21, 2025 01:18
Copilot AI requested a review from squirrelsc October 21, 2025 01:18
Copy link
Member

@squirrelsc squirrelsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot resolve conflicts with main branch

Copilot AI and others added 2 commits October 21, 2025 01:45
…r_size metrics

Co-authored-by: squirrelsc <27178119+squirrelsc@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot resolve conflicts with main branch

Merged main branch successfully. The merge added MetricRelativity.Parameter enum which is now used for parameter-type metrics. (commit 59068fe)

Copilot AI requested a review from squirrelsc October 21, 2025 01:48
Copilot finished work on behalf of squirrelsc October 21, 2025 01:48
Co-authored-by: squirrelsc <27178119+squirrelsc@users.noreply.github.com>
Copilot finished work on behalf of squirrelsc October 21, 2025 01:56
Copilot AI requested a review from squirrelsc October 21, 2025 01:56
@squirrelsc squirrelsc marked this pull request as ready for review October 21, 2025 03:23
@squirrelsc squirrelsc requested a review from LiliDeng as a code owner October 21, 2025 03:23
@squirrelsc
Copy link
Member

@LiliDeng LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants