fix(web-probe): hard cap analyze stdout (#720)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -8247,6 +8247,41 @@ function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOptions, spec
|
||||
" valuesRedacted: true",
|
||||
" };",
|
||||
" output = compactOutput(tiny);",
|
||||
" if (Buffer.byteLength(output, 'utf8') > compactStdoutLimitBytes) {",
|
||||
" const ultratiny = {",
|
||||
" ok: compact.ok,",
|
||||
" counts: compact.counts ?? null,",
|
||||
" analysisWindow: compact.analysisWindow ?? null,",
|
||||
" archiveSummary: compact.archiveSummary ?? null,",
|
||||
" sampleMetrics: compact.sampleMetrics ? {",
|
||||
" sampleCount: compact.sampleMetrics.sampleCount ?? null,",
|
||||
" loadingSampleCount: compact.sampleMetrics.loadingSampleCount ?? null,",
|
||||
" loadingMaxCount: compact.sampleMetrics.loadingMaxCount ?? null,",
|
||||
" loadingOverFiveSecondSegmentCount: compact.sampleMetrics.loadingOverFiveSecondSegmentCount ?? null,",
|
||||
" sessionRailFallbackMajoritySampleCount: compact.sampleMetrics.sessionRailFallbackMajoritySampleCount ?? compact.sampleMetrics.sessionRailTitles?.summary?.majorityFallbackSampleCount ?? null,",
|
||||
" turnTimingRows: compact.sampleMetrics.turnTimingRows ?? null,",
|
||||
" turnTimingTotalElapsedForwardJumpCount: compact.sampleMetrics.turnTimingTotalElapsedForwardJumpCount ?? null,",
|
||||
" turnTimingRecentUpdateJumpCount: compact.sampleMetrics.turnTimingRecentUpdateJumpCount ?? compact.sampleMetrics.turnTimingRecentUpdateSawtoothJumpCount ?? null",
|
||||
" } : null,",
|
||||
" runtimeAlerts: compact.runtimeAlerts ?? null,",
|
||||
" pagePerformance: compact.pagePerformance ?? null,",
|
||||
" findings: Array.isArray(compact.findings) ? compact.findings.slice(0, 4).map((item) => ({ kind: item.kind ?? item.code ?? null, severity: item.severity ?? item.level ?? null, count: item.count ?? item.sampleCount ?? null, summary: clip(item.summary ?? item.message, 120) })) : [],",
|
||||
" httpErrorGroups: Array.isArray(compact.httpErrorGroups) ? compact.httpErrorGroups.slice(0, 2).map((item) => ({ count: item.count ?? null, method: item.method ?? null, status: item.status ?? null, path: item.path ?? null, lastAt: item.lastAt ?? null })) : [],",
|
||||
" requestFailedGroups: Array.isArray(compact.requestFailedGroups) ? compact.requestFailedGroups.slice(0, 2).map((item) => ({ count: item.count ?? null, method: item.method ?? null, path: item.path ?? null, failureKinds: item.failureKinds ?? null })) : [],",
|
||||
" pagePerformanceSlowApi: Array.isArray(compact.pagePerformanceSlowApi) ? compact.pagePerformanceSlowApi.slice(0, 2).map((item) => ({ path: item.path ?? item.route ?? null, sampleCount: item.sampleCount ?? null, p95Ms: item.p95Ms ?? null, maxMs: item.maxMs ?? null, overFiveSecondCount: item.overFiveSecondCount ?? null })) : [],",
|
||||
" pagePerformanceSseStreams: Array.isArray(compact.pagePerformanceSseStreams) ? compact.pagePerformanceSseStreams.slice(0, 2).map((item) => ({ path: item.path ?? item.route ?? null, sampleCount: item.sampleCount ?? null, streamOpenP95Ms: item.streamOpenP95Ms ?? null, streamOpenMaxMs: item.streamOpenMaxMs ?? null, streamOpenOverFiveSecondCount: item.streamOpenOverFiveSecondCount ?? null, streamLifetimeOverFiveSecondCount: item.streamLifetimeOverFiveSecondCount ?? null })) : [],",
|
||||
" reportJsonPath: compact.reportJsonPath ?? reportJsonPath,",
|
||||
" reportJsonSha256: compact.reportJsonSha256 ?? sha256(reportJsonPath),",
|
||||
" reportMdPath: compact.reportMdPath ?? reportMdPath,",
|
||||
" reportMdSha256: compact.reportMdSha256 ?? sha256(reportMdPath),",
|
||||
" analyzer: { ...(compact.analyzer ?? {}), compactStdoutLimited: true, ultratiny: true, compactStdoutLimitBytes, originalCompactBytes: Buffer.byteLength(compactOutput(compact), 'utf8'), originalTinyBytes: Buffer.byteLength(output, 'utf8') },",
|
||||
" valuesRedacted: true",
|
||||
" };",
|
||||
" output = compactOutput(ultratiny);",
|
||||
" }",
|
||||
" if (Buffer.byteLength(output, 'utf8') > compactStdoutLimitBytes) {",
|
||||
" output = compactOutput({ ok: compact.ok, counts: compact.counts ?? null, analysisWindow: compact.analysisWindow ?? null, archiveSummary: compact.archiveSummary ?? null, reportJsonPath: compact.reportJsonPath ?? reportJsonPath, reportJsonSha256: compact.reportJsonSha256 ?? sha256(reportJsonPath), reportMdPath: compact.reportMdPath ?? reportMdPath, reportMdSha256: compact.reportMdSha256 ?? sha256(reportMdPath), analyzer: { ...(compact.analyzer ?? {}), compactStdoutLimited: true, ultratiny: true, hardFallback: true, compactStdoutLimitBytes }, valuesRedacted: true });",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"console.log(output);",
|
||||
|
||||
Reference in New Issue
Block a user