Skip to content

Conversation

@lukehb
Copy link
Contributor

@lukehb lukehb commented May 28, 2025

Relevant components:

  • Frontend library
  • Frontend UI library

Problem statement:

Adds a new feature to run a variable length latency test session (e.g. a 60s window) and dump that stats from the session to two .csv files:

  1. latency.csv - Which contains the video timing stats
  2. stats.csv - Which contains all WebRTC stats the library currently tracks

Additionally: It was found useful to support running this test against UE 4.27 for internal historical testing, so support for connecting to this version has been restored.

Solution

  • Adds a new class Frontend\ui-library\src\UI\SessionTest.ts
  • Adds a new flag/url parameter, ?LatencyCSV that enables this feature (by default it is disabled)
  • This new flag is only configurable via url parameters/programmatically and not via UI as some other settings are.
  • 4.27 compatibility was restored by re-shipping the flag ?BrowserSendOffer which makes the browser send the WebRTC offer (this should only be used with 4.27 projects).

Documentation

This feature is for advanced use and internal testing only so both the ?LatencyCSV and ?BrowserSendOffer flags are disabled by default.

To use this new feature:

  1. Navigate to http://localhost/?LatencyCSV.
  2. Open the stats panel and click Run Test under the Session Test heading.

Optional for 4.27 projects: Add ?BrowserSendOffer to the url parameters or set it programmatically.

Test Plan and Compatibility

  • Feature has been tested locally on Windows to ensure it only shows when the flag is set
  • Feature has been tested on AWS and Windows to ensure the feature produces .csv files with latency stats.
  • Feature was tested against UE version 4.27 - 5.6 and was compatible.

image

Belchy06 and others added 16 commits April 11, 2025 11:18
(cherry picked from commit 152abd6)

Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
(cherry picked from commit 1dedc87)
[LatencyTest] Fixing path setup in the windows platform scripts. (#594) (#595)
* feat: Adding script tests where the scripts are run multiple times.

This tests that the scripts still work when things have already been
installed.

* fix: Fixing typo in github action.

* gimme a break.

* Adding mutliple script runs for other OSs

* Testing node on the runner

* Trying to figure out what node is doing what.

* Trying to change the way node version is detected.

* Messy

* The additions to the script really didn't catch anything. Could be worth
revisiting how we handle the local node install.

* Removing debug print.

(cherry picked from commit 2321fa9)
[LatencyTest] Fixing more path issues in platform_scripts (#604)
Updated the way the bash script sets up the environment for node.
Node will only be installed if a version meeting the minimum requirements is not found.
The new environment should result in a more robust environment setup.

(cherry picked from commit f27bace)
[LatencyTest] refactor: Better handling of node in Linux scripts. (#607)
If the node install was installed locally previously the script would
not pick that up and try to install again. It would fail because the
directory already exists and then the path would not get properly setup
for the local install of node.
This change sets PATH to point to the local install anyway. If it doesn't
exist it doesn't matter, if it does exist we use the local install.

(cherry picked from commit 00aaa52)
[LatencyTest] Fixing a small issue with how path was setup previously. (#611)
@changeset-bot
Copy link

changeset-bot bot commented May 28, 2025

🦋 Changeset detected

Latest commit: bf5ee5a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.6 Minor
@epicgames-ps/lib-pixelstreamingfrontend-ue5.6 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukehb lukehb changed the title Add dump latency stats to CSV Feature: Dump latency stats to CSV | Re-ship 4.27 browser send offer support May 28, 2025
@lukehb lukehb changed the title Feature: Dump latency stats to CSV | Re-ship 4.27 browser send offer support Feature: Dump latency stats to CSV | Re-ship: 4.27 browser send offer support May 28, 2025
@lukehb lukehb added auto-backport Used to specify we want a PR to auto backport to a branch, must be paired with auto-backport-to-UEX. auto-backport-to-UE5.6 labels May 28, 2025
@lukehb lukehb requested review from Belchy06 and mcottontensor May 28, 2025 05:22
@mcottontensor mcottontensor merged commit c61fd7b into master May 29, 2025
8 checks passed
github-actions bot added a commit that referenced this pull request May 29, 2025
… support (#647)

* Add 4.27 support back for latency testing

* Save webrtc stats to csv and auto download

* Deep copy stats object

* Update record parsing logic to handle missing field when generating the csv

* Update session test to handle additional latency stats

* Fixing path setup in the windows platform scripts. (#594) (#595)

(cherry picked from commit 152abd6)

Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
(cherry picked from commit 1dedc87)

* Fixing more path issues in platform_scripts (#604)

* feat: Adding script tests where the scripts are run multiple times.

This tests that the scripts still work when things have already been
installed.

* fix: Fixing typo in github action.

* gimme a break.

* Adding mutliple script runs for other OSs

* Testing node on the runner

* Trying to figure out what node is doing what.

* Trying to change the way node version is detected.

* Messy

* The additions to the script really didn't catch anything. Could be worth
revisiting how we handle the local node install.

* Removing debug print.

(cherry picked from commit 2321fa9)

* refactor: Better handling of node in Linux scripts. (#607)

Updated the way the bash script sets up the environment for node.
Node will only be installed if a version meeting the minimum requirements is not found.
The new environment should result in a more robust environment setup.

(cherry picked from commit f27bace)

* Fixing a small issue with how path was setup previously. (#611)

If the node install was installed locally previously the script would
not pick that up and try to install again. It would fail because the
directory already exists and then the path would not get properly setup
for the local install of node.
This change sets PATH to point to the local install anyway. If it doesn't
exist it doesn't matter, if it does exist we use the local install.

(cherry picked from commit 00aaa52)

* Added disable button when session test is running

* Added new flag ?LatencyCSV to enable the session test and its UI

* Added changeset for 4.27 support and session test feature

---------

Co-authored-by: Will Belcher <william.belcher@xa.epicgames.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
(cherry picked from commit c61fd7b)
@github-actions
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
UE5.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@mcottontensor mcottontensor deleted the LatencyTest branch May 29, 2025 00:48
mcottontensor added a commit that referenced this pull request May 29, 2025
… support (#647) (#651)

* Add 4.27 support back for latency testing

* Save webrtc stats to csv and auto download

* Deep copy stats object

* Update record parsing logic to handle missing field when generating the csv

* Update session test to handle additional latency stats

* Fixing path setup in the windows platform scripts. (#594) (#595)

(cherry picked from commit 152abd6)


(cherry picked from commit 1dedc87)

* Fixing more path issues in platform_scripts (#604)

* feat: Adding script tests where the scripts are run multiple times.

This tests that the scripts still work when things have already been
installed.

* fix: Fixing typo in github action.

* gimme a break.

* Adding mutliple script runs for other OSs

* Testing node on the runner

* Trying to figure out what node is doing what.

* Trying to change the way node version is detected.

* Messy

* The additions to the script really didn't catch anything. Could be worth
revisiting how we handle the local node install.

* Removing debug print.

(cherry picked from commit 2321fa9)

* refactor: Better handling of node in Linux scripts. (#607)

Updated the way the bash script sets up the environment for node.
Node will only be installed if a version meeting the minimum requirements is not found.
The new environment should result in a more robust environment setup.

(cherry picked from commit f27bace)

* Fixing a small issue with how path was setup previously. (#611)

If the node install was installed locally previously the script would
not pick that up and try to install again. It would fail because the
directory already exists and then the path would not get properly setup
for the local install of node.
This change sets PATH to point to the local install anyway. If it doesn't
exist it doesn't matter, if it does exist we use the local install.

(cherry picked from commit 00aaa52)

* Added disable button when session test is running

* Added new flag ?LatencyCSV to enable the session test and its UI

* Added changeset for 4.27 support and session test feature

---------




(cherry picked from commit c61fd7b)

Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com>
Co-authored-by: Will Belcher <william.belcher@xa.epicgames.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Used to specify we want a PR to auto backport to a branch, must be paired with auto-backport-to-UEX. auto-backport-to-UE5.6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants