{"id":19952630,"url":"https://github.com/qxip/webrtc-test-alpine","last_synced_at":"2025-05-03T19:30:49.861Z","repository":{"id":39759384,"uuid":"369573378","full_name":"QXIP/webrtc-test-alpine","owner":"QXIP","description":"WebRTC Chromium RTC Quality Tester w/ PaStash output","archived":false,"fork":false,"pushed_at":"2023-03-06T02:39:06.000Z","size":4239,"stargazers_count":8,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T20:21:23.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QXIP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-21T15:10:25.000Z","updated_at":"2023-06-10T05:53:50.000Z","dependencies_parsed_at":"2023-02-18T10:32:10.350Z","dependency_job_id":null,"html_url":"https://github.com/QXIP/webrtc-test-alpine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Fwebrtc-test-alpine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Fwebrtc-test-alpine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Fwebrtc-test-alpine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2Fwebrtc-test-alpine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QXIP","download_url":"https://codeload.github.com/QXIP/webrtc-test-alpine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252241941,"owners_count":21717073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:13:55.173Z","updated_at":"2025-05-03T19:30:49.533Z","avatar_url":"https://github.com/QXIP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebRTC stress test\nA tool for running concurrent WebRTC sessions using chromium web browser in headless mode.\n\nComponents used:\n- NodeJS application.\n- Puppeteer library for controlling chromium instances.\n- RTC stats logging with [paStash](https://github.com/sipcapture/paStash).\n\n## Configuration options\n\nSee the [config documentation](CONFIG.md).\n\nThe `DEBUG_LEVEL` environment is used for enabled debug messages; see [debug-level](https://github.com/commenthol/debug-level#readme) for syntax.\n\n## Statistics\n\nExample output:\n\n```\n-- Mon, 08 Mar 2021 11:41:48 GMT -------------------------------------------------------------------\n                          name    count      sum     mean   stddev      25p      min      max\n                           cpu        1    67.66    67.66     0.00    67.66    67.66    67.66 %\n                        memory        1   801.13   801.13     0.00   801.13   801.13   801.13 MB\n                          tabs        1        1        1        0        1        1        1\n-- Inbound audio -----------------------------------------------------------------------------------\n                      received        1     0.02     0.02     0.00     0.02     0.02     0.02 MB\n                          rate        1     0.53     0.53     0.00     0.53     0.53     0.53 Kbps\n                          lost        1              0.00     0.00     0.00     0.00     0.00 %\n                        jitter        1              0.00     0.00     0.00     0.00     0.00 s\n          avgJitterBufferDelay        1             85.27     0.00    85.27    85.27    85.27 ms\n-- Inbound video -----------------------------------------------------------------------------------\n                      received        2    26.62    13.31    13.22    13.31     0.09    26.53 MB\n                          rate        2   838.72   419.36   411.30   419.36     8.06   830.66 Kbps\n                          lost        1              0.00     0.00     0.00     0.00     0.00 %\n                        jitter        1              1.88     0.37     1.77     0.98     2.65 s\n          avgJitterBufferDelay        1             90.86     0.00    90.86    90.86    90.86 ms\n                         width        1              1280        0     1280     1280     1280 px\n                        height        1               720        0      720      720      720 px\n-- Outbound audio ----------------------------------------------------------------------------------\n                          sent        1     0.50     0.50     0.00     0.50     0.50     0.50 MB\n                 retransmitted        1     0.00     0.00     0.00     0.00     0.00     0.00 MB\n                          rate        1     0.00     0.00     0.00     0.00     0.00     0.00 Kbps\n-- Outbound video ----------------------------------------------------------------------------------\n                          sent        3    43.62    14.54     7.70    10.06     4.68    23.49 MB\n                 retransmitted        3     0.00     0.00     0.00     0.00     0.00     0.00 MB\n                          rate        3     0.00     0.00     0.00     0.00     0.00     0.00 Kbps\n qualityLimitResolutionChanges        3        0        0        0        0        0        0\n                         width        1              1280        0     1280     1280     1280 px\n                        height        1               720        0      720      720      720 px\n                           fps        1                25        0       25       25       25 fps\n```\n\nStatistics values:\n\n| Name                      | Count        | Desscription |\n| :------------------------ | :----------- | :----------- |\n| cpu                       | Total sessions | The browser process cpu usage. |\n| memory                    | Total sessions | The browser process memory usage. |\n| tabs                      | Total sessions | The browser current opened tabs. |\n| received                  | Total inbound streams | The `bytesReceived` value for each stream. |\n| sent                      | Total outbound streams | The `bytesSent` value for each stream. |\n| retransmitted             | Total outbound streams | The `retransmittedBytesSent` value for each stream. |\n| rate                      | Total streams | The stream bitrate. |\n| lost                      | Total streams | The stream [lost packets](https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-packetslost) %. |\n| jitter                    | Total streams | The stream [jitter](https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-jitter) in seconds. |\n| avgJitterBufferDelay      | Total decoded tracks | The inbound average [jitter buffer delay](https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferdelay). |\n| qualityLimitResolutionChanges   | Total outbound video streams | The `qualityLimitationResolutionChanges` [value](https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges) for each outbound video stream. |\n| width                     | Total sent or received videos | The sent or received video width. |\n| height                    | Total sent or received videos | The sent or received video height. |\n| fps                       | Total sent | The sent video frames per second. |\n\n## Examples\n\nSee the 'examples' folder\n\n### Mediasoup demo\n\nStarts one send-receive participant:\n\n```sh\ndocker pull qxip/webrtc-stress-test-pastash:latest\ndocker run -it --rm --name=webrtc-stress-test-publisher \\\n    -v /dev/shm:/dev/shm \\\n    -e VIDEO_PATH=/app/video.mp4 \\\n    -e URL=$MEDIASOUP_DEMO_URL \\\n    -e URL_QUERY='roomId=test\u0026displayName=Publisher-$s-$t' \\\n    -e SESSIONS=1 \\\n    -e TABS_PER_SESSION=1 \\\n    -e SHOW_STATS=false \\\n    -e ENABLE_RTC_STATS=true \\\n    -e PASTASH_WSS='wss://pastash.collector:9090' \\\n    -e PASTASH_ID='my_test_123' \\\n    qxip/webrtc-stress-test-pastash:latest\n```\n\nStarts 10 receive-only participants:\n\n```sh\ndocker pull qxip/webrtc-stress-test-pastash:latest\ndocker run -it --rm --name=webrtc-stress-test-viewer \\\n    -v /dev/shm:/dev/shm \\\n    -e URL=$MEDIASOUP_DEMO_URL \\\n    -e URL_QUERY='roomId=test\u0026displayName=Viewer-$s-$t\u0026produce=false' \\\n    -e SESSIONS=1 \\\n    -e TABS_PER_SESSION=10 \\\n    -e SHOW_STATS=false \\\n    -e ENABLE_RTC_STATS=true \\\n    -e PASTASH_WSS='wss://pastash.collector:9090' \\\n    -e PASTASH_ID='my_test_123' \\\n    qxip/webrtc-stress-test-pastash:latest\n```\n\n### Meething\n\nStarts one send-receive participant, with a random id:\n\n```sh\ndocker pull qxip/webrtc-stress-test-pastash:latest\ndocker run -it --rm --name=webrtc-stress-test-publisher \\\n    -v /dev/shm:/dev/shm \\\n    -e VIDEO_PATH=/app/video.mp4 \\\n    -e URL=$MEETHING_URL \\\n    -e SCRIPT_PATH=/app/scripts/meething.js \\\n    -e SESSIONS=1 \\\n    -e TABS_PER_SESSION=1 \\\n    -e SHOW_STATS=false \\\n    -e ENABLE_RTC_STATS=true \\\n    -e PASTASH_WSS='wss://pastash.collector:9090' \\\n    -e PASTASH_ID='my_test_123' \\\n    qxip/webrtc-stress-test-pastash:latest\n```\n\n### Jitsi\n\nStarts one send-receive participant:\n\n```sh\ndocker pull qxip/webrtc-stress-test-pastash:latest\ndocker run -it --rm --name=webrtc-stress-test-publisher \\\n    -v /dev/shm:/dev/shm \\\n    -e VIDEO_PATH=/app/video.mp4 \\\n    -e URL=$JITSI_ROOM_URL \\\n    -e URL_QUERY='#config.prejoinPageEnabled=false\u0026userInfo.displayName=Participant-$s-$t' \\\n    -e SESSIONS=1 \\\n    -e TABS_PER_SESSION=1 \\\n    -e SHOW_STATS=false \\\n    -e ENABLE_RTC_STATS=true \\\n    -e PASTASH_WSS='wss://pastash.collector:9090' \\\n    -e PASTASH_ID='my_test_123' \\\n    qxip/webrtc-stress-test-pastash:latest\n```\n\n\n## Running from source code\n\n```sh\ngit clone https://github.com/qxip/webrtc-stress-test-pastash.git\n\ncd webrtc-stress-test\n\n# build the chromium customized version\n# cd chromium\n# ./build.sh setup\n# ./build.sh apply_patch\n# ./build.sh build\n# install the package (on Ubuntu/Debian)\n# dpkg -i ./chromium-browser-unstable_\u003cversion\u003e-1_amd64.deb\n# cd ..\n\n# sendrecv test\nDEBUG_LEVEL=DEBUG:* yarn start:dev \\\n    --url=https://127.0.0.1:3443/test \\\n    --url-query='displayName=SendRecv $s/$S-$t/$T' \\\n    --video-path=./video.mp4 \\\n    --script-path=./scripts/edumeet-sendrecv.js \\\n    --sessions=1 \\\n    --tabs-per-session=1 \\\n    --enable-page-log=true\n\n# recv only\nDEBUG_LEVEL=DEBUG:* yarn start:dev \\\n    --url=https://127.0.0.1:3443/test \\\n    --url-query='displayName=Recv $s/$S-$t/$T' \\\n    --script-path=./scripts/edumeet-recv.js \\\n    --sessions=1 \\\n    --tabs-per-session=10 \\\n    --enable-page-log=true \\\n    --use-null-video-decoder=true\n```\n\n## Setup\nInstall pastash \u0026 the required plugins using npm\n```\nnpm install -g @pastash/pastash @pastash/output_loki\n```\n\n---------------\n\n## Pastash Collector Recipe\nThe following recipe will provide a websocket receiver for webRTC statistics on port `9090` and shipping to Grafana Loki\nCreate and store this on your filesystem, ie: `/some/path/to/pastash.conf` and add in your `grafana` account details:\n```\ninput {\n  ws {\n    host =\u003e 0.0.0.0\n    port =\u003e 9090\n    ssl =\u003e true\n    ssl_key =\u003e \"/etc/letsencrypt/live/your.domain/privkey.pem\"\n    ssl_cert =\u003e \"/etc/letsencrypt/live/your.domain/cert.pem\"\n  }\n}\n\noutput {\n  loki {\n    basic_auth_password =\u003e \"some_very_secure_password_hash_here\"\n    basic_auth_user =\u003e \"1234\"\n    host =\u003e \"logs-us-west1.grafana.net\"\n    port =\u003e 80\n    path =\u003e \"/api/prom/push\"\n  }\n}\n```\n\nOnce you're ready, run your paStash socket manually or using pm2\n\n```\npastash --config_file=/some/path/to/pastash.conf\n```\n\n\n### Credits\n\n* Based on [webrtc-stress-test](https://github.com/vpalmisano)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fwebrtc-test-alpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqxip%2Fwebrtc-test-alpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fwebrtc-test-alpine/lists"}