Keep web perf marker names stable
Some checks are pending
ci-gates / checks (push) Waiting to run
deploy-cloudflare / checks (push) Waiting to run
deploy-cloudflare / deploy (push) Blocked by required conditions

This commit is contained in:
Conrad Kramer 2026-06-10 02:40:26 -07:00
parent 797f96e7eb
commit 168e9928a5
No known key found for this signature in database

View file

@ -40,7 +40,12 @@ function perfNow() {
function markPerf(name, detail) { function markPerf(name, detail) {
const at = perfNow(); const at = perfNow();
const event = { name, at_ms: Math.round(at), ...(detail || {}) }; const safeDetail = { ...(detail || {}) };
if (Object.prototype.hasOwnProperty.call(safeDetail, "name")) {
safeDetail.stream_name = safeDetail.name;
delete safeDetail.name;
}
const event = { name, at_ms: Math.round(at), ...safeDetail };
perfState.marks[name] = event; perfState.marks[name] = event;
perfState.events.push(event); perfState.events.push(event);
if (window.performance && typeof window.performance.mark === "function") { if (window.performance && typeof window.performance.mark === "function") {