Skip to content
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

[WEBRTC-2347] [feat] Stats #145

Merged
merged 31 commits into from
Jan 9, 2025
Merged

[WEBRTC-2347] [feat] Stats #145

merged 31 commits into from
Jan 9, 2025

Conversation

gbattistel
Copy link
Collaborator

@gbattistel gbattistel commented Nov 29, 2024

WEBRTC-2347 [feat] WebRTC Stats

Add WebRTCStatsReporter and Enhance Peer Connection Event Handling

Summary:

This PR introduces significant improvements to the WebRTC integration, including a new WebRTCStatsReporter class, a debug property for enabling/disabling statistics monitoring, and enhanced event handling via the WebRTCEventHandler protocol.

Key Changes:

WebRTCStatsReporter:

Periodically collects WebRTC statistics, including audio streams and connection candidates.
Sends these statistics to the server via a socket using a specific structured format.
Adds support for extracting detailed connection information, such as the selected candidate pair.

Debugging Property:

Introduces a debug property in TxConfig to enable or disable the monitoring of WebRTC statistics.
The property defaults to false, ensuring performance optimization unless debugging is explicitly required.

Enhanced Event Handling:

Implements WebRTCEventHandler to standardize handling key WebRTC events, such as signaling state changes, ICE candidate updates, and data channel events.
Adds detailed debug messages for event logging and diagnostics.

@gbattistel gbattistel marked this pull request as draft November 29, 2024 12:12
isaacakakpo1
isaacakakpo1 previously approved these changes Nov 29, 2024
…rt to a dictionary required by the stats messages
Send a start message before initializing the peer connection to avoid losing peer events. The correct message sequence is:
1. Start message before creating the peer connection.
2. Add connection message after the peer connection is created.
3. Subscribe to all RTCPeerConnection events.
@gbattistel gbattistel marked this pull request as ready for review December 5, 2024 14:32
Copy link

@Oliver-Zimmerman Oliver-Zimmerman left a comment

Choose a reason for hiding this comment

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

Minor comments.

Will test when I have access to testflight

TelnyxRTC/Telnyx/WebRTC/Stats/WebRTCStatsReporter.swift Outdated Show resolved Hide resolved
TelnyxRTC/Telnyx/WebRTC/Stats/WebRTCStatsReporter.swift Outdated Show resolved Hide resolved
TelnyxRTC/Telnyx/WebRTC/Stats/WebRTCStatsReporter.swift Outdated Show resolved Hide resolved
Copy link

@Oliver-Zimmerman Oliver-Zimmerman left a comment

Choose a reason for hiding this comment

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

Tested and was able to generate a json file that works as expected.

@gbattistel gbattistel merged commit 0fce8a4 into main Jan 9, 2025
1 check passed
@gbattistel gbattistel deleted the feat/WEBRTC-2347-stats branch January 9, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants