Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to measure bandwidth of a WebRTC data channel

Is there a best way to measure incoming or outgoing message size of a WebRTC message?

like image 516
Peter Ehrlich Avatar asked Oct 20 '22 05:10

Peter Ehrlich


2 Answers

I ended up altering PeerJS to return a Blob on connection.send. This blob has a size parameter, in bytes. I don't know (yet) if this is exactly the size-on wire, but it seems like a good start.

https://developer.mozilla.org/en-US/docs/Web/API/Blob.size

like image 151
Peter Ehrlich Avatar answered Oct 23 '22 01:10

Peter Ehrlich


Two possible options

  1. You have chrome://webrtc-internals there you can see the incoming and outgoing throughput of your data channel: http://imgur.com/2xrpgNz
  2. By message size you mean just your application's payload? or including SCTP, IP, etc' overheads?
like image 30
shacharz Avatar answered Oct 23 '22 00:10

shacharz