|
|
|
@@ -2181,7 +2181,11 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" promptSegments: selectedMetrics.promptSegments ?? selectedSummary?.promptSegments ?? null",
|
|
|
|
|
"} : null;",
|
|
|
|
|
"const srcRuntimeAlerts = objectOrNull(source?.runtimeAlerts);",
|
|
|
|
|
"const runtimeAlerts = srcRuntimeAlerts ? { httpErrorCount: srcRuntimeAlerts.httpErrorCount ?? null, requestFailedCount: srcRuntimeAlerts.requestFailedCount ?? null, domDiagnosticSampleCount: srcRuntimeAlerts.domDiagnosticSampleCount ?? null, consoleAlertCount: srcRuntimeAlerts.consoleAlertCount ?? null } : null;",
|
|
|
|
|
"const runtimeAlertSummary = objectOrNull(srcRuntimeAlerts?.summary);",
|
|
|
|
|
"const runtimeAlerts = srcRuntimeAlerts ? { httpErrorCount: srcRuntimeAlerts.httpErrorCount ?? runtimeAlertSummary?.httpErrorCount ?? null, requestFailedCount: srcRuntimeAlerts.requestFailedCount ?? runtimeAlertSummary?.requestFailedCount ?? null, domDiagnosticSampleCount: srcRuntimeAlerts.domDiagnosticSampleCount ?? runtimeAlertSummary?.domDiagnosticSampleCount ?? null, consoleAlertCount: srcRuntimeAlerts.consoleAlertCount ?? runtimeAlertSummary?.consoleAlertCount ?? null, webPerformancePayloadRequestCount: srcRuntimeAlerts.webPerformancePayloadRequestCount ?? runtimeAlertSummary?.webPerformancePayloadRequestCount ?? null, webPerformancePayloadParsedCount: srcRuntimeAlerts.webPerformancePayloadParsedCount ?? runtimeAlertSummary?.webPerformancePayloadParsedCount ?? null, webPerformancePayloadParseIssueCount: srcRuntimeAlerts.webPerformancePayloadParseIssueCount ?? runtimeAlertSummary?.webPerformancePayloadParseIssueCount ?? null, webPerformanceRuntimeDiagnosticCount: srcRuntimeAlerts.webPerformanceRuntimeDiagnosticCount ?? runtimeAlertSummary?.webPerformanceRuntimeDiagnosticCount ?? null, webPerformanceRuntimeDiagnosticGroupCount: srcRuntimeAlerts.webPerformanceRuntimeDiagnosticGroupCount ?? runtimeAlertSummary?.webPerformanceRuntimeDiagnosticGroupCount ?? null } : null;",
|
|
|
|
|
"const slimWebPerformanceGroup = (item) => { const v = objectOrNull(item) || {}; return { diagnosticCode: clip(v.diagnosticCode, 80), reason: clip(v.reason, 60), module: clip(v.module, 80), eventType: clip(v.eventType, 40), count: v.count ?? null, eventCount: v.eventCount ?? null, deliveredCount: v.deliveredCount ?? null, chunkCount: v.chunkCount ?? null, droppedCount: v.droppedCount ?? null, maxFlushDurationMs: v.maxFlushDurationMs ?? null, maxItemsPerChunk: v.maxItemsPerChunk ?? null, maxChunkMs: v.maxChunkMs ?? null, replacedByKeyCount: v.replacedByKeyCount ?? null, firstAt: v.firstAt ?? null, lastAt: v.lastAt ?? null, valuesRedacted: true }; };",
|
|
|
|
|
"const webPerformancePayloadStates = objectOrNull(srcRuntimeAlerts?.webPerformancePayloadStates) || objectOrNull(fullRecentWindow?.runtimeAlerts?.webPerformancePayloadStates) || objectOrNull(fullSource?.runtimeAlerts?.webPerformancePayloadStates);",
|
|
|
|
|
"const webPerformanceRuntimeDiagnostics = { summary: runtimeAlerts ? { payloadRequestCount: runtimeAlerts.webPerformancePayloadRequestCount ?? 0, payloadParsedCount: runtimeAlerts.webPerformancePayloadParsedCount ?? 0, payloadParseIssueCount: runtimeAlerts.webPerformancePayloadParseIssueCount ?? 0, runtimeDiagnosticCount: runtimeAlerts.webPerformanceRuntimeDiagnosticCount ?? 0, runtimeDiagnosticGroupCount: runtimeAlerts.webPerformanceRuntimeDiagnosticGroupCount ?? 0, capturedEventCount: webPerformancePayloadStates?.capturedEventCount ?? null, storedEventCount: webPerformancePayloadStates?.storedEventCount ?? null, valuesRedacted: true } : null, states: takeHead(firstNonEmptyArray(webPerformancePayloadStates?.states), 6), groups: takeHead(firstNonEmptyArray(srcRuntimeAlerts?.webPerformanceRuntimeDiagnosticsByCode, fullRecentWindow?.runtimeAlerts?.webPerformanceRuntimeDiagnosticsByCode, fullSource?.runtimeAlerts?.webPerformanceRuntimeDiagnosticsByCode), 6).map(slimWebPerformanceGroup), valuesRedacted: true };",
|
|
|
|
|
"const srcPagePerformance = objectOrNull(source?.pagePerformance);",
|
|
|
|
|
"const srcPagePerformanceSummary = objectOrNull(srcPagePerformance?.summary);",
|
|
|
|
|
"const pagePerformance = srcPagePerformance ? { sameOriginApiPaths: srcPagePerformance.sameOriginApiPaths ?? srcPagePerformanceSummary?.sameOriginApiPathCount ?? null, longLivedStreamPathCount: srcPagePerformance.longLivedStreamPathCount ?? srcPagePerformanceSummary?.longLivedStreamPathCount ?? null, longLivedStreamOpenOverFiveSecondSampleCount: srcPagePerformance.longLivedStreamOpenOverFiveSecondSampleCount ?? srcPagePerformanceSummary?.longLivedStreamOpenOverFiveSecondSampleCount ?? null, slowPathCount: srcPagePerformance.slowPathCount ?? srcPagePerformanceSummary?.slowPathCount ?? null, slowSampleCount: srcPagePerformance.slowSampleCount ?? srcPagePerformanceSummary?.slowSampleCount ?? null, worstP95Ms: srcPagePerformance.worstP95Ms ?? srcPagePerformanceSummary?.worstP95Ms ?? null } : null;",
|
|
|
|
@@ -2217,6 +2221,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" archiveSummary: objectOrNull(source.archiveSummary),",
|
|
|
|
|
" sampleMetrics: metrics,",
|
|
|
|
|
" runtimeAlerts,",
|
|
|
|
|
" webPerformanceRuntimeDiagnostics,",
|
|
|
|
|
" pagePerformance,",
|
|
|
|
|
" projectManagement,",
|
|
|
|
|
" promptNetwork,",
|
|
|
|
@@ -2311,6 +2316,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" turnColumns: minimalTurnColumns",
|
|
|
|
|
" } : null,",
|
|
|
|
|
" runtimeAlerts: compact.runtimeAlerts ?? null,",
|
|
|
|
|
" webPerformanceRuntimeDiagnostics: compact.webPerformanceRuntimeDiagnostics ?? null,",
|
|
|
|
|
" pagePerformance: compact.pagePerformance ?? null,",
|
|
|
|
|
" requestRate: compact.requestRate ?? null,",
|
|
|
|
|
" requestRateCurve: compact.requestRateCurve ? { summary: compact.requestRateCurve.summary ?? null, buckets: Array.isArray(compact.requestRateCurve.buckets) ? compact.requestRateCurve.buckets.slice(-6) : [], pageCurves: Array.isArray(compact.requestRateCurve.pageCurves) ? compact.requestRateCurve.pageCurves.slice(0, 4).map((item) => ({ pageKey: item.pageKey ?? null, path: item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-6) : [] })) : [], apiPathCurves: Array.isArray(compact.requestRateCurve.apiPathCurves) ? compact.requestRateCurve.apiPathCurves.slice(0, 6).map((item) => ({ apiKey: item.apiKey ?? null, path: item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-6) : [] })) : [], valuesRedacted: true } : null,",
|
|
|
|
@@ -2380,6 +2386,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" turnTimingRecentUpdateJumpCount: compact.sampleMetrics.turnTimingRecentUpdateJumpCount ?? compact.sampleMetrics.turnTimingRecentUpdateSawtoothJumpCount ?? null",
|
|
|
|
|
" } : null,",
|
|
|
|
|
" runtimeAlerts: compact.runtimeAlerts ?? null,",
|
|
|
|
|
" webPerformanceRuntimeDiagnostics: compact.webPerformanceRuntimeDiagnostics ?? null,",
|
|
|
|
|
" pagePerformance: compact.pagePerformance ?? null,",
|
|
|
|
|
" requestRate: compact.requestRate ?? null,",
|
|
|
|
|
" requestRateCurve: compact.requestRateCurve ? { summary: compact.requestRateCurve.summary ?? null, buckets: Array.isArray(compact.requestRateCurve.buckets) ? compact.requestRateCurve.buckets.slice(-6) : [], pageCurves: Array.isArray(compact.requestRateCurve.pageCurves) ? compact.requestRateCurve.pageCurves.slice(0, 3).map((item) => ({ pageKey: item.pageKey ?? null, path: item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-6) : [] })) : [], apiPathCurves: Array.isArray(compact.requestRateCurve.apiPathCurves) ? compact.requestRateCurve.apiPathCurves.slice(0, 4).map((item) => ({ apiKey: item.apiKey ?? null, path: item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-6) : [] })) : [], valuesRedacted: true } : null,",
|
|
|
|
@@ -2424,6 +2431,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" turnTimingRecentUpdateJumpCount: compact.sampleMetrics.turnTimingRecentUpdateJumpCount ?? compact.sampleMetrics.turnTimingRecentUpdateSawtoothJumpCount ?? null",
|
|
|
|
|
" } : null,",
|
|
|
|
|
" runtimeAlerts: compact.runtimeAlerts ?? null,",
|
|
|
|
|
" webPerformanceRuntimeDiagnostics: compact.webPerformanceRuntimeDiagnostics ?? null,",
|
|
|
|
|
" pagePerformance: compact.pagePerformance ?? null,",
|
|
|
|
|
" requestRate: compact.requestRate ?? null,",
|
|
|
|
|
" requestRatePeaks: Array.isArray(compact.requestRatePeaks) ? compact.requestRatePeaks.slice(0, 3) : [],",
|
|
|
|
@@ -2451,7 +2459,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" output = compactOutput(ultratiny);",
|
|
|
|
|
" }",
|
|
|
|
|
" if (Buffer.byteLength(output, 'utf8') > compactStdoutLimitBytes) {",
|
|
|
|
|
" output = compactOutput({ ok: compact.ok, counts: compact.counts ?? null, jsonlScope: compact.jsonlScope ?? null, analysisWindow: compact.analysisWindow ?? null, archiveSummary: compact.archiveSummary ? { redFindingCount: compact.archiveSummary.redFindingCount ?? null, findingCount: compact.archiveSummary.findingCount ?? null, sampleCount: compact.archiveSummary.sampleMetrics?.sampleCount ?? null, slowPathCount: compact.archiveSummary.pagePerformance?.slowPathCount ?? null } : null, requestRate: compact.requestRate ?? null, requestRateCurve: compact.requestRateCurve ? { summary: compact.requestRateCurve.summary ?? null, buckets: Array.isArray(compact.requestRateCurve.buckets) ? compact.requestRateCurve.buckets.slice(-4) : [], pageCurves: Array.isArray(compact.requestRateCurve.pageCurves) ? compact.requestRateCurve.pageCurves.slice(0, 2).map((item) => ({ path: item.path ?? item.pageKey ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-4) : [] })) : [], apiPathCurves: Array.isArray(compact.requestRateCurve.apiPathCurves) ? compact.requestRateCurve.apiPathCurves.slice(0, 3).map((item) => ({ apiKey: item.apiKey ?? item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-4) : [] })) : [], valuesRedacted: true } : null, requestRatePeaks: Array.isArray(compact.requestRatePeaks) ? compact.requestRatePeaks.slice(0, 3) : [], projectManagement: compact.projectManagement ? { summary: compact.projectManagement.summary ?? compact.projectManagement, samples: Array.isArray(compact.projectManagement.samples) ? compact.projectManagement.samples.slice(-2) : [], commands: Array.isArray(compact.projectManagement.commands) ? compact.projectManagement.commands.slice(-2) : [], launchCommands: Array.isArray(compact.projectManagement.launchCommands) ? compact.projectManagement.launchCommands.slice(-2) : [], projectApiByPath: Array.isArray(compact.projectManagement.projectApiByPath) ? compact.projectManagement.projectApiByPath.slice(0, 2) : [], valuesRedacted: true } : null, toolFindings: Array.isArray(compact.toolFindings) ? compact.toolFindings.slice(0, 8) : [], commandState: compact.commandState ? { pendingCount: compact.commandState.pendingCount ?? null, processingCount: compact.commandState.processingCount ?? null, abandonedCount: compact.commandState.abandonedCount ?? null, failedCount: compact.commandState.failedCount ?? null } : 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, timingSourceOfTruth: item.timingSourceOfTruth ?? null, timingStatus: item.timingStatus ?? null, timingAlert: item.timingAlert === true, summary: clip(item.summary ?? item.message, 120) })) : [], archiveRedFindings: Array.isArray(compact.archiveRedFindings) ? compact.archiveRedFindings.slice(0, 4).map((item) => ({ kind: item.kind ?? item.code ?? null, severity: item.severity ?? item.level ?? null, count: item.count ?? item.sampleCount ?? null, timingSourceOfTruth: item.timingSourceOfTruth ?? null, timingStatus: item.timingStatus ?? null, timingAlert: item.timingAlert === true, summary: clip(item.summary ?? item.message, 120) })) : [], commandFailures: Array.isArray(compact.commandFailures) ? compact.commandFailures.slice(-3).map((item) => ({ ts: item.ts ?? null, type: item.type ?? null, commandId: item.commandId ?? null, durationMs: item.durationMs ?? null, sampleSeq: item.sampleSeq ?? null, beforePath: item.beforePath ?? null, afterPath: item.afterPath ?? null, message: clip(item.message ?? item.failureKind ?? item.name, 120) })) : [], archivePagePerformanceSlowApi: Array.isArray(compact.archivePagePerformanceSlowApi) ? compact.archivePagePerformanceSlowApi.slice(0, 4).map((item) => ({ path: item.path ?? item.route ?? null, sampleCount: item.sampleCount ?? null, p95Ms: item.p95Ms ?? null, maxMs: item.maxMs ?? null, overFiveSecondCount: item.overFiveSecondCount ?? 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 });",
|
|
|
|
|
" output = compactOutput({ ok: compact.ok, counts: compact.counts ?? null, jsonlScope: compact.jsonlScope ?? null, analysisWindow: compact.analysisWindow ?? null, archiveSummary: compact.archiveSummary ? { redFindingCount: compact.archiveSummary.redFindingCount ?? null, findingCount: compact.archiveSummary.findingCount ?? null, sampleCount: compact.archiveSummary.sampleMetrics?.sampleCount ?? null, slowPathCount: compact.archiveSummary.pagePerformance?.slowPathCount ?? null } : null, requestRate: compact.requestRate ?? null, requestRateCurve: compact.requestRateCurve ? { summary: compact.requestRateCurve.summary ?? null, buckets: Array.isArray(compact.requestRateCurve.buckets) ? compact.requestRateCurve.buckets.slice(-4) : [], pageCurves: Array.isArray(compact.requestRateCurve.pageCurves) ? compact.requestRateCurve.pageCurves.slice(0, 2).map((item) => ({ path: item.path ?? item.pageKey ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-4) : [] })) : [], apiPathCurves: Array.isArray(compact.requestRateCurve.apiPathCurves) ? compact.requestRateCurve.apiPathCurves.slice(0, 3).map((item) => ({ apiKey: item.apiKey ?? item.path ?? null, count: item.count ?? null, peakRequestPerMinute: item.peakRequestPerMinute ?? null, peakBucket: item.peakBucket ?? null, buckets: Array.isArray(item.buckets) ? item.buckets.slice(-4) : [] })) : [], valuesRedacted: true } : null, requestRatePeaks: Array.isArray(compact.requestRatePeaks) ? compact.requestRatePeaks.slice(0, 3) : [], webPerformanceRuntimeDiagnostics: compact.webPerformanceRuntimeDiagnostics ?? null, projectManagement: compact.projectManagement ? { summary: compact.projectManagement.summary ?? compact.projectManagement, samples: Array.isArray(compact.projectManagement.samples) ? compact.projectManagement.samples.slice(-2) : [], commands: Array.isArray(compact.projectManagement.commands) ? compact.projectManagement.commands.slice(-2) : [], launchCommands: Array.isArray(compact.projectManagement.launchCommands) ? compact.projectManagement.launchCommands.slice(-2) : [], projectApiByPath: Array.isArray(compact.projectManagement.projectApiByPath) ? compact.projectManagement.projectApiByPath.slice(0, 2) : [], valuesRedacted: true } : null, toolFindings: Array.isArray(compact.toolFindings) ? compact.toolFindings.slice(0, 8) : [], commandState: compact.commandState ? { pendingCount: compact.commandState.pendingCount ?? null, processingCount: compact.commandState.processingCount ?? null, abandonedCount: compact.commandState.abandonedCount ?? null, failedCount: compact.commandState.failedCount ?? null } : 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, timingSourceOfTruth: item.timingSourceOfTruth ?? null, timingStatus: item.timingStatus ?? null, timingAlert: item.timingAlert === true, summary: clip(item.summary ?? item.message, 120) })) : [], archiveRedFindings: Array.isArray(compact.archiveRedFindings) ? compact.archiveRedFindings.slice(0, 4).map((item) => ({ kind: item.kind ?? item.code ?? null, severity: item.severity ?? item.level ?? null, count: item.count ?? item.sampleCount ?? null, timingSourceOfTruth: item.timingSourceOfTruth ?? null, timingStatus: item.timingStatus ?? null, timingAlert: item.timingAlert === true, summary: clip(item.summary ?? item.message, 120) })) : [], commandFailures: Array.isArray(compact.commandFailures) ? compact.commandFailures.slice(-3).map((item) => ({ ts: item.ts ?? null, type: item.type ?? null, commandId: item.commandId ?? null, durationMs: item.durationMs ?? null, sampleSeq: item.sampleSeq ?? null, beforePath: item.beforePath ?? null, afterPath: item.afterPath ?? null, message: clip(item.message ?? item.failureKind ?? item.name, 120) })) : [], archivePagePerformanceSlowApi: Array.isArray(compact.archivePagePerformanceSlowApi) ? compact.archivePagePerformanceSlowApi.slice(0, 4).map((item) => ({ path: item.path ?? item.route ?? null, sampleCount: item.sampleCount ?? null, p95Ms: item.p95Ms ?? null, maxMs: item.maxMs ?? null, overFiveSecondCount: item.overFiveSecondCount ?? 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 });",
|
|
|
|
|
" }",
|
|
|
|
|
" }",
|
|
|
|
|
"}",
|
|
|
|
@@ -2467,6 +2475,7 @@ export function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOption
|
|
|
|
|
" sampleMetrics: compact.sampleMetrics ? { sampleCount: compact.sampleMetrics.sampleCount ?? null, roundCount: Array.isArray(compact.sampleMetrics.rounds) ? compact.sampleMetrics.rounds.length : null, turnColumnCount: Array.isArray(compact.sampleMetrics.turnColumns) ? compact.sampleMetrics.turnColumns.length : null, turnTimingRows: compact.sampleMetrics.turnTimingRows ?? null, turnTimingTotalElapsedForwardJumpCount: compact.sampleMetrics.turnTimingTotalElapsedForwardJumpCount ?? null, turnTimingRecentUpdateJumpCount: compact.sampleMetrics.turnTimingRecentUpdateJumpCount ?? compact.sampleMetrics.turnTimingRecentUpdateSawtoothJumpCount ?? null, loadingSampleCount: compact.sampleMetrics.loadingSampleCount ?? null, loadingMaxCount: compact.sampleMetrics.loadingMaxCount ?? null, loadingOverFiveSecondSegmentCount: compact.sampleMetrics.loadingOverFiveSecondSegmentCount ?? null } : null,",
|
|
|
|
|
" requestRate: compact.requestRate ? { requestCount: compact.requestRate.requestCount ?? null, totalPeakPerMinute: compact.requestRate.totalPeakPerMinute ?? null, pagePeakPerMinute: compact.requestRate.pagePeakPerMinute ?? null, apiPathPeakPerMinute: compact.requestRate.apiPathPeakPerMinute ?? null, overThresholdPeakCount: compact.requestRate.overThresholdPeakCount ?? null } : null,",
|
|
|
|
|
" frontendPerformance: frontend ? { eventCount: frontend.eventCount ?? null, longTaskCount: frontend.longTaskCount ?? null, longAnimationFrameCount: frontend.longAnimationFrameCount ?? null, eventLoopGapCount: frontend.eventLoopGapCount ?? null, captureCount: frontend.captureCount ?? null, maxLongTaskMs: frontend.maxLongTaskMs ?? null, maxLongAnimationFrameMs: frontend.maxLongAnimationFrameMs ?? null, maxEventLoopGapMs: frontend.maxEventLoopGapMs ?? null, profileHotspotCount: frontend.profileHotspotCount ?? null, scriptHotspotCount: frontend.scriptHotspotCount ?? null, profileFunctions: takeHead(frontendHotspots.profileFunctions, 3).map((item) => ({ functionName: clip(item?.functionName ?? item?.name, 64), url: clip(item?.url ?? item?.sourceURL, 96), selfTimeMs: item?.selfTimeMs ?? null, totalTimeMs: item?.totalTimeMs ?? null, hitCount: item?.hitCount ?? null })), profileStacks: takeHead(frontendHotspots.profileStacks, 2).map((item) => ({ functionName: clip(item?.functionName ?? item?.name, 64), selfTimeMs: item?.selfTimeMs ?? null, frameCount: item?.frameCount ?? (Array.isArray(item?.frames) ? item.frames.length : null) })), scripts: takeHead(frontendHotspots.scripts, 3).map((item) => ({ functionName: clip(item?.sourceFunctionName ?? item?.functionName ?? item?.invoker, 64), url: clip(item?.sourceURL ?? item?.url, 96), totalDurationMs: item?.totalDurationMs ?? null, count: item?.count ?? null })) } : null,",
|
|
|
|
|
" webPerformanceRuntimeDiagnostics: compact.webPerformanceRuntimeDiagnostics ?? null,",
|
|
|
|
|
" commandState: compact.commandState ? { pendingCount: compact.commandState.pendingCount ?? null, processingCount: compact.commandState.processingCount ?? null, abandonedCount: compact.commandState.abandonedCount ?? null, failedCount: compact.commandState.failedCount ?? null } : 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, 100) })) : [],",
|
|
|
|
|
" archiveRedFindings: Array.isArray(compact.archiveRedFindings) ? compact.archiveRedFindings.slice(0, 3).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, 100) })) : [],",
|
|
|
|
|