Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

[MV-410] Add getStats function #34

Merged
merged 4 commits into from
Apr 28, 2023
Merged

[MV-410] Add getStats function #34

merged 4 commits into from
Apr 28, 2023

Conversation

skyman503
Copy link
Contributor

@skyman503 skyman503 commented Apr 27, 2023

This PR mimics fishjam-dev/membrane-webrtc-android@1f88e81 but for IOS sdk

@skyman503 skyman503 marked this pull request as ready for review April 27, 2023 14:27
let tmp = RTCOutboundStats(
kind: it.values["kind"] as? String ?? "",
rid: it.values["rid"] as? String ?? "",
bytesSent: it.values["bytesSent"] as? Int ?? 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

it's int? not any big number? or NSDecimalNumber?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Int on a modern IPhone has 63 bit precision, which should be more than enough since when changed from bytes it would mean that the peer must have had used several petabytes to exceed that, and backed would prob crash first :P. I changed it to be UInt to get that additional bit of precision, but I think it is irrelevant.

}

public func getStats() -> [String: RTCStats] {
if connection != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if connection != nil {
if let connection = connection {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@skyman503 skyman503 merged commit f0929f8 into master Apr 28, 2023
@skyman503 skyman503 deleted the skyman503/MV-410 branch April 28, 2023 10:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants