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

Time-to-first-frame metrics benchmarking and timeline chart #286

Merged
merged 17 commits into from
Dec 21, 2023

Conversation

niyatim23
Copy link
Contributor

@niyatim23 niyatim23 commented Nov 14, 2023

Issue #, if available:

What was changed?
Introduced a new feature which allows receiving master-side metrics in the JS viewer

Why was it changed?
It would be easier to understand the time-to-first-frame and which process on both sides is time-consuming and how much time does each API call take

How was it changed?

  • The master-side (KVS WebRTC C SDK) metrics are sent to the viewer in multiple JSON messages via the datachannel opened by the viewer
  • The datachannel first sends a message of the following format with t1 attached, to which the master responds back with the same message attaching t2. In response to this, the viewer sends the same message back with t3 and so on until t5. The viewer is responsible for attaching t1, t3, t5. The master is responsible for t2 and t4. (Master e2e time: t4 - t2, Viewer e2e time: t3 - t1):
let dataChannelLatencyCalcMessage = {
    content: 'Opened data channel by viewer',
    t1: '',
    t2: '',
    t3: '',
    t4: '',
    t5: ''
}

What testing was done for the changes?
Tested the changes locally by running the master first and the viewer first to see that the plot had all the relevant values

Viewer is started first
Screenshot 2023-11-14 at 9 10 02 AM

Master is started first
Screenshot 2023-11-14 at 9 10 47 AM

Tooltip
Untitled

Datachannel messages from master
Screenshot 2023-11-14 at 9 11 16 AM

Checkbox
Screenshot 2023-12-19 at 9 00 54 PM

Timer
Screenshot 2023-12-19 at 8 56 01 PM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@niyatim23 niyatim23 requested a review from sirknightj November 14, 2023 17:25
@sirknightj sirknightj added enhancement New feature or request Samples Questions related to Samples labels Nov 14, 2023
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Show resolved Hide resolved
@sirknightj
Copy link
Contributor

We'll merge this in at the same time as awslabs/amazon-kinesis-video-streams-webrtc-sdk-c#1846

README.md Outdated Show resolved Hide resolved
examples/viewer.js Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Outdated Show resolved Hide resolved
examples/viewer.js Show resolved Hide resolved
examples/index.html Outdated Show resolved Hide resolved
@niyatim23 niyatim23 merged commit 2a4b3ba into develop Dec 21, 2023
4 checks passed
@niyatim23 niyatim23 deleted the datachannel-benchmarking branch December 21, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Samples Questions related to Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants