feat: add project-management web-probe observe
This commit is contained in:
@@ -2133,6 +2133,17 @@ function renderMarkdown(report) {
|
||||
const traceOrder = report.sampleMetrics?.traceOrder || {};
|
||||
const traceOrderSummary = traceOrder.summary || {};
|
||||
const alertSummary = report.runtimeAlerts?.summary || {};
|
||||
const projectManagement = report.projectManagement || {};
|
||||
const projectSummary = projectManagement.summary || {};
|
||||
const projectCommandLines = Array.isArray(projectManagement.commands) && projectManagement.commands.length > 0
|
||||
? projectManagement.commands.slice(0, 40).map((item) => "- " + (item.ts || "-") + " " + (item.phase || "-") + " " + (item.type || "-") + " command=" + (item.commandId || "-") + " status=" + (item.launchStatus ?? "-") + " session=" + (item.sessionId || "-") + " otel=" + (item.otelTraceId || "-") + " taskHash=" + (item.selectedTaskRefHash || "-")).join("\n")
|
||||
: "- 无项目管理控制命令。";
|
||||
const projectApiLines = Array.isArray(projectManagement.projectApiByPath) && projectManagement.projectApiByPath.length > 0
|
||||
? projectManagement.projectApiByPath.slice(0, 40).map((item) => "- " + (item.method || "-") + " " + (item.path || "-") + " type=" + (item.type || "-") + " status=" + (item.status ?? "-") + " count=" + (item.count ?? 0) + " first=" + (item.firstAt || "-") + " last=" + (item.lastAt || "-")).join("\n")
|
||||
: "- 无项目管理自然 API 记录。";
|
||||
const projectSampleLines = Array.isArray(projectManagement.samples) && projectManagement.samples.length > 0
|
||||
? projectManagement.samples.slice(-40).map((item) => "- #" + (item.seq ?? "-") + " " + (item.ts || "-") + " role=" + (item.pageRole || "-") + " kind=" + (item.pageKind || "-") + " src=" + (item.sourceCount ?? "-") + " files=" + (item.fileCount ?? "-") + " tasks=" + (item.taskCount ?? "-") + " selectedTask=" + (item.selectedTaskRefHash || "-") + " launchEnabled=" + String(item.launchButtonEnabled === true) + " links=" + (item.workbenchLinkCount ?? 0)).join("\n")
|
||||
: "- 无项目管理 DOM 采样。";
|
||||
const httpAlertLines = Array.isArray(report.runtimeAlerts?.networkHttpErrorsByPath) && report.runtimeAlerts.networkHttpErrorsByPath.length > 0
|
||||
? report.runtimeAlerts.networkHttpErrorsByPath.slice(0, 40).map((item) => "- HTTP " + (item.status ?? "-") + " " + item.method + " " + item.urlPath + " count=" + item.count + " prompts=" + (item.promptIndexes?.join(",") || "-") + " first=" + (item.firstAt || "-") + " last=" + (item.lastAt || "-")).join("\n")
|
||||
: "- 无 HTTP 错误。";
|
||||
@@ -2225,6 +2236,19 @@ function renderMarkdown(report) {
|
||||
+ "- console: " + (report.counts.console ?? 0) + "\n"
|
||||
+ "- errors: " + report.counts.errors + "\n\n"
|
||||
+ "## Findings\n\n" + findingLines + "\n\n"
|
||||
+ "## Project management\n\n"
|
||||
+ "- enabled: " + String(projectSummary.enabled === true) + "\n"
|
||||
+ "- projectSampleCount: " + (projectSummary.projectSampleCount ?? 0) + "\n"
|
||||
+ "- mdtodoSampleCount: " + (projectSummary.mdtodoSampleCount ?? 0) + "\n"
|
||||
+ "- latestPageKind: " + (projectSummary.latestPageKind || "-") + "\n"
|
||||
+ "- latestPath: " + (projectSummary.latestPath || "-") + "\n"
|
||||
+ "- latestCounts: source=" + (projectSummary.latestSourceCount ?? "-") + " file=" + (projectSummary.latestFileCount ?? "-") + " task=" + (projectSummary.latestTaskCount ?? "-") + "\n"
|
||||
+ "- latestSelectedTaskRefHash: " + (projectSummary.latestSelectedTaskRefHash || "-") + "\n"
|
||||
+ "- launch: commands=" + (projectSummary.launchCommandCount ?? 0) + " success=" + (projectSummary.launchSuccessCount ?? 0) + " failure=" + (projectSummary.launchFailureCount ?? 0) + " otelTraceHeader=" + (projectSummary.launchWithOtelTraceHeaderCount ?? 0) + "\n"
|
||||
+ "- projectApi: responses=" + (projectSummary.projectApiResponseCount ?? 0) + " failures=" + (projectSummary.projectApiFailureCount ?? 0) + " requestfailed=" + (projectSummary.projectApiRequestFailedCount ?? 0) + " slowPaths=" + (projectSummary.projectApiSlowPathCount ?? 0) + "\n\n"
|
||||
+ "### Project samples\n\n" + projectSampleLines + "\n\n"
|
||||
+ "### Project commands\n\n" + projectCommandLines + "\n\n"
|
||||
+ "### Project API\n\n" + projectApiLines + "\n\n"
|
||||
+ "## Command failures\n\n" + commandFailureLines + "\n\n"
|
||||
+ "## Sample metrics\n\n"
|
||||
+ "- sampleCount: " + (metricSummary.sampleCount ?? 0) + "\n"
|
||||
|
||||
Reference in New Issue
Block a user