Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Time to decoded frame: The calculation methodology for was incorrect. The way it was being measured would not give an accurate representation of the actual time taken to decode the first received frame. The application current uses
inbound-stats
to measure this value and these stats are polled every 1 second, which means, there is a possibility that the time calculated is 1 second more than what it actually took to decode the first frame. This PR fixes it by listening in on the[onloadeddata](https://www.w3schools.com/jsref/event_onloadeddata.asp)
event tied to the master video element which is invoked when the first frame is received.Time to P2P: The calculation for this is from the start of viewer button click to when the first
track
event is received. This is not a real measure of P2P, or atleast it is not clear what the intent of this is. This PR gets rid of this and instead adds 3 more metrics: Time taken for signaling setup, Time to set up viewer video view element and time taken from offer to first frame decode.Time from viewer button click to first frame decode: Added a new measure to indicate the total time taken to get the remote view on the screen.
Selected candidate pair: Added details on the selected local and remote candidate which will show up after 10 seconds.
Modified time unit to ms display for latency measurements to be accurate.
Before this change:
Initial view:
![Screenshot 2023-12-14 at 3 34 52 PM](https://private-user-images.githubusercontent.com/22107309/290684057-7fe6404c-93e6-45dc-8ebb-0aa1560250a2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODI2MTksIm5iZiI6MTczOTM4MjMxOSwicGF0aCI6Ii8yMjEwNzMwOS8yOTA2ODQwNTctN2ZlNjQwNGMtOTNlNi00NWRjLThlYmItMGFhMTU2MDI1MGEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE3NDUxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4YWU5OTc1YmFjYWMyYjdlMmUwZWIzNzllZmQ4MmI0NTM3NDkxZTA0YjFlYWU1ODRjMGQ2ODY5MmI2ZWU0NTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Rr67PtZAyPqb76d_QnpgRdeN5Il5gqJPOV1xbFH8_F4)
After 120 seconds:
![Screenshot 2023-12-14 at 3 37 40 PM](https://private-user-images.githubusercontent.com/22107309/290684069-7fdfcb3b-6c13-4f17-9987-848f530a11c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODI2MTksIm5iZiI6MTczOTM4MjMxOSwicGF0aCI6Ii8yMjEwNzMwOS8yOTA2ODQwNjktN2ZkZmNiM2ItNmMxMy00ZjE3LTk5ODctODQ4ZjUzMGExMWMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE3NDUxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1Yzk0ZmMwNDkwYzQ5YWI4NGRlZDgzNDZjMWU4NWU1N2RlNzU0ZmI1ZjIwYmYwZjBlN2ZiNTAzODdjODE2NmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nrA61CVevSkkDmBo6TEYl0koli_zktfMNnOzfYrEgdA)
After this PR:
Initial view:
![Screenshot 2023-12-14 at 3 41 17 PM](https://private-user-images.githubusercontent.com/22107309/290684572-87fd5c2b-0c2b-4637-b5d9-4fff53b81b17.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODI2MTksIm5iZiI6MTczOTM4MjMxOSwicGF0aCI6Ii8yMjEwNzMwOS8yOTA2ODQ1NzItODdmZDVjMmItMGMyYi00NjM3LWI1ZDktNGZmZjUzYjgxYjE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE3NDUxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5N2QzYmU1NTA5ODU1MTY3ZjUyODNkMjVhZjdmMDlmYmFmNzFlYzk5MmNjNmQzNjQ4YTRkNWJlZDhiMjI4NzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.FGAjd2XfBie7JfzSu3CR4ztx8Fw0t32uWC73KqviLrI)
After 10 seconds:
Note from the screenshot how there is a 931ms difference between
Time to decoded stream (as seen from inbound stats)
andTime from viewer button click to first decoded frame
.To do:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.