




















@@ -450,6 +450,10 @@ export type QaSuiteSummaryJsonParams = {
450450 */
451451export type { QaSuiteSummaryJson } from "./suite-summary.js";
452452453+type QaSuiteGatewayRssSample = NonNullable<
454+NonNullable<QaSuiteSummaryJson["metrics"]>["gatewayProcessRssSamples"]
455+>[number];
456+453457/**
454458 * Pure-ish JSON builder for qa-suite-summary.json. Exported so the GPT-5.5
455459 * parity gate (agentic-parity-report.ts, #64441) and any future parity
@@ -762,8 +766,16 @@ function buildQaSuiteRuntimeMetrics(params: {
762766gatewayProcessCpuEndMs: number | null;
763767gatewayProcessRssStartBytes: number | null;
764768gatewayProcessRssEndBytes: number | null;
769+gatewayProcessRssSamples?: QaSuiteGatewayRssSample[];
765770}): QaSuiteSummaryJson["metrics"] {
766771const wallMs = Math.max(1, params.finishedAt.getTime() - params.startedAt.getTime());
772+const gatewayProcessRssSamples = params.gatewayProcessRssSamples ?? [];
773+const gatewayProcessRssPeakBytes =
774+gatewayProcessRssSamples.length > 0
775+ ? Math.max(...gatewayProcessRssSamples.map((sample) => sample.gatewayProcessRssBytes))
776+ : params.gatewayProcessRssStartBytes === null || params.gatewayProcessRssEndBytes === null
777+ ? null
778+ : Math.max(params.gatewayProcessRssStartBytes, params.gatewayProcessRssEndBytes);
767779const rssMetrics =
768780params.gatewayProcessRssStartBytes === null || params.gatewayProcessRssEndBytes === null
769781 ? {}
@@ -772,6 +784,16 @@ function buildQaSuiteRuntimeMetrics(params: {
772784gatewayProcessRssEndBytes: params.gatewayProcessRssEndBytes,
773785gatewayProcessRssDeltaBytes:
774786params.gatewayProcessRssEndBytes - params.gatewayProcessRssStartBytes,
787+ ...(gatewayProcessRssPeakBytes === null
788+ ? {}
789+ : {
790+ gatewayProcessRssPeakBytes,
791+gatewayProcessRssPeakDeltaBytes:
792+gatewayProcessRssPeakBytes - params.gatewayProcessRssStartBytes,
793+}),
794+ ...(gatewayProcessRssSamples.length === 0
795+ ? {}
796+ : { gatewayProcessRssSamples }),
775797};
776798if (params.gatewayProcessCpuStartMs === null || params.gatewayProcessCpuEndMs === null) {
777799return { wallMs, ...rssMetrics };
@@ -1196,14 +1218,27 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
11961218scenarios: liveScenarioOutcomes,
11971219});
119812201221+const gatewayProcessRssSamples: QaSuiteGatewayRssSample[] = [];
1222+const sampleGatewayProcessRss = (label: string) => {
1223+const gatewayProcessRssBytes = gateway.getProcessRssBytes?.() ?? null;
1224+if (gatewayProcessRssBytes !== null) {
1225+gatewayProcessRssSamples.push({
1226+ label,
1227+at: new Date().toISOString(),
1228+ gatewayProcessRssBytes,
1229+});
1230+}
1231+return gatewayProcessRssBytes;
1232+};
11991233const gatewayProcessCpuStartMs = gateway.getProcessCpuMs?.() ?? null;
1200-const gatewayProcessRssStartBytes = gateway.getProcessRssBytes?.() ?? null;
1234+const gatewayProcessRssStartBytes = sampleGatewayProcessRss("suite-start");
12011235for (const [index, scenario] of selectedCatalogScenarios.entries()) {
12021236const scenarioIdForLog = sanitizeQaSuiteProgressValue(scenario.id);
12031237writeQaSuiteProgress(
12041238progressEnabled,
12051239`scenario start (${index + 1}/${selectedCatalogScenarios.length}): ${scenarioIdForLog}`,
12061240);
1241+sampleGatewayProcessRss(`scenario:${scenario.id}:start`);
12071242liveScenarioOutcomes[index] = {
12081243id: scenario.id,
12091244name: scenario.title,
@@ -1218,6 +1253,7 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
12181253});
1219125412201255const result = await runScenarioDefinition(env, scenario);
1256+sampleGatewayProcessRss(`scenario:${scenario.id}:finish`);
12211257scenarios.push(result);
12221258writeQaSuiteProgress(
12231259progressEnabled,
@@ -1260,7 +1296,8 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
12601296 gatewayProcessCpuStartMs,
12611297gatewayProcessCpuEndMs: gateway.getProcessCpuMs?.() ?? null,
12621298 gatewayProcessRssStartBytes,
1263-gatewayProcessRssEndBytes: gateway.getProcessRssBytes?.() ?? null,
1299+gatewayProcessRssEndBytes: sampleGatewayProcessRss("suite-finish"),
1300+ gatewayProcessRssSamples,
12641301});
12651302const failedCount = scenarios.filter((scenario) => scenario.status === "fail").length;
12661303if (scenarios.some((scenario) => scenario.status === "fail")) {
@@ -1336,6 +1373,7 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
13361373}
1337137413381375export const qaSuiteProgressTesting = {
1376+ buildQaSuiteRuntimeMetrics,
13391377 buildQaRuntimeEnvPatch,
13401378 parseQaSuiteBooleanEnv,
13411379 remapModelRefForForcedRuntime,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。