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

Make Bytes/Messages Sent/Received public on data channels #2766

Closed

Conversation

danjenkins
Copy link

Description

BytesReceived, BytesSent, MessagesReceived and MessagesSent are all used to create stats but sometimes you don't want to go through all the stats...

This makes those methods available directly on a data channel

I'm not sure we need to add any tests... they're already tested in datachannel module

@danjenkins
Copy link
Author

Actually, I don't think this is necessary, I've just got this info via GetStats() and it worked well. Let me know what you think

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.41%. Comparing base (aa9c623) to head (ae18317).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2766       +/-   ##
===========================================
- Coverage   78.91%   64.41%   -14.50%     
===========================================
  Files          87       65       -22     
  Lines        8208     3164     -5044     
===========================================
- Hits         6477     2038     -4439     
+ Misses       1263      997      -266     
+ Partials      468      129      -339     
Flag Coverage Δ
go ?
wasm 64.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der
Copy link
Member

Sean-Der commented May 9, 2024

Thanks for the PR @danjenkins!

I don't see these in the W3C docs, so my gut says we probably should not do it. I am afraid if we have inconsistent APIs between implementations that it will frustrate users :(

If the GetStats API doesn't have something you need tell me and I would love to implement it!

https://www.w3.org/TR/webrtc/#webidl-1143016005

@Sean-Der Sean-Der closed this May 9, 2024
@danjenkins
Copy link
Author

Thanks for the PR @danjenkins!

I don't see these in the W3C docs, so my gut says we probably should not do it. I am afraid if we have inconsistent APIs between implementations that it will frustrate users :(

If the GetStats API doesn't have something you need tell me and I would love to implement it!

https://www.w3.org/TR/webrtc/#webidl-1143016005

Completely agree. Once I'd realised how to go grab these stats then things fell into place

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.

None yet

2 participants