fix(web-probe): aggregate numeric sse flush replacements

This commit is contained in:
Codex
2026-07-02 17:12:04 +00:00
parent 049ebf2539
commit 9d691596f1
4 changed files with 15 additions and 6 deletions
@@ -119,12 +119,13 @@ async function writeState(): Promise<string> {
traceId: "trc_webperf_fixture",
sessionIdHash: "sha256:session",
eventCount: 12,
deliveredCount: 10,
chunkCount: 3,
flushDurationMs: 18.75,
droppedCount: 2,
maxItemsPerChunk: 5,
maxChunkMs: 7.5,
replacedByKey: true,
replacedByKey: 3,
valuesRedacted: true,
}],
valuesRedacted: true,
@@ -181,9 +182,10 @@ test("analyzer and performance-summary include bounded web-performance runtime d
assert.equal(groups[0].reason, "sse_flush");
assert.equal(groups[0].module, "workbench-runtime");
assert.equal(groups[0].eventCount, 12);
assert.equal(groups[0].deliveredCount, 10);
assert.equal(groups[0].chunkCount, 3);
assert.equal(groups[0].maxFlushDurationMs, 18.75);
assert.equal(groups[0].replacedByKeyCount, 1);
assert.equal(groups[0].replacedByKeyCount, 3);
const reportText = JSON.stringify(report);
assert.match(reportText, /workbench_sse_flush/u);
@@ -209,6 +211,6 @@ test("analyzer and performance-summary include bounded web-performance runtime d
assert.match(renderedText, /Web performance runtime diagnostics/u);
assert.match(renderedText, /payloads=3 parsed=1 parseIssues=2 events=1 groups=1/u);
assert.match(renderedText, /workbench_sse_flush reason=sse_flush module=workbench-runtime/u);
assert.match(renderedText, /eventCount=12 chunks=3 flushMax=18.75ms dropped=2/u);
assert.match(renderedText, /eventCount=12 delivered=10 chunks=3 flushMax=18.75ms dropped=2/u);
assert.match(renderedText, /payload states=invalid-json:1, not-parsed-over-limit:1, parsed:1/u);
}, 20_000);