File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -997,8 +997,33 @@ cmd_baseline() {
997997 if [ " ${i} " -le " ${POLLS} " ]; then sleep " ${POLL_DELAY} " ; fi
998998 done
999999 printf ' mean: total_ms=%s server_ms=%s\n' " $(( total_ms / POLLS)) " " $(( total_srv / POLLS)) "
1000- printf ' \nNote: baseline requests are NOT tagged with X-RTC-Test.\n'
1001- printf ' Run "bash rtc-test.sh report" to see baseline overhead vs RTC scenarios.\n'
1000+
1001+ # Also poll the RTC endpoint so baseline latency is captured in the log table.
1002+ # Always tagged with approach=baseline regardless of $APPROACH, so all runs
1003+ # across all approaches accumulate into a single results['baseline']['baseline']
1004+ # bucket with N*approaches entries.
1005+ require_auth
1006+ printf ' \nLogging %d RTC baseline polls (approach=baseline)...\n' " ${POLLS} "
1007+ local rtc_baseline_opts=(
1008+ --silent --show-error
1009+ -b " ${WP_COOKIE_JAR} "
1010+ -H " X-WP-Nonce: ${WP_NONCE} "
1011+ -H " X-RTC-Test: 1"
1012+ -H " Content-Type: application/json"
1013+ -H " X-RTC-Approach: baseline"
1014+ -H " X-RTC-Scenario: baseline"
1015+ )
1016+ local room body rtc_url
1017+ room=$( build_room_json " ${CLIENT_A} " " ${AWARENESS_A} " " 0" " " )
1018+ body=$( build_rooms_json " ${room} " )
1019+ rtc_url=" ${RTC_ENDPOINT} ?_rtctest=1&_rtcscenario=baseline&_rtcapproach=baseline&_wpnonce=${WP_NONCE} "
1020+ i=1
1021+ while [ " ${i} " -le " ${POLLS} " ]; do
1022+ curl " ${rtc_baseline_opts[@]} " -X POST " ${rtc_url} " -d " ${body} " -o /dev/null
1023+ printf ' poll %2d logged\n' " ${i} "
1024+ i=$(( i + 1 ))
1025+ if [ " ${i} " -le " ${POLLS} " ]; then sleep " ${POLL_DELAY} " ; fi
1026+ done
10021027}
10031028
10041029cmd_single_idle () {
You can’t perform that action at this time.
0 commit comments