Skip to content

Commit b2e1e39

Browse files
authored
fix: roll latest DevTools to handle Insight errors (#149)
This commit updates DevTools to the latest release. This most importantly includes a fix for #124 and other reported issues where Insights that were actually errors were not handled correctly. They are now formatted correctly on the DevTools side and now will not break performance traces in the MCP server.
1 parent 1527754 commit b2e1e39

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@types/yargs": "^17.0.33",
5252
"@typescript-eslint/eslint-plugin": "^8.43.0",
5353
"@typescript-eslint/parser": "^8.43.0",
54-
"chrome-devtools-frontend": "1.0.1516909",
54+
"chrome-devtools-frontend": "1.0.1520139",
5555
"eslint": "^9.35.0",
5656
"eslint-plugin-import": "^2.32.0",
5757
"eslint-import-resolver-typescript": "^4.4.4",

src/trace-processing/parse.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ export async function parseRawTraceBuffer(
7474
}
7575

7676
export function getTraceSummary(result: TraceResult): string {
77-
const focus = AgentFocus.full(result.parsedTrace);
78-
const serializer = new TraceEngine.EventsSerializer.EventsSerializer();
79-
const formatter = new PerformanceTraceFormatter(focus, serializer);
77+
const focus = AgentFocus.fromParsedTrace(result.parsedTrace);
78+
const formatter = new PerformanceTraceFormatter(
79+
focus,
80+
PerformanceInsightFormatter.create,
81+
);
8082
const output = formatter.formatTraceSummary();
8183
return output;
8284
}
@@ -122,7 +124,7 @@ export function getInsightOutput(
122124
}
123125

124126
const formatter = new PerformanceInsightFormatter(
125-
result.parsedTrace,
127+
AgentFocus.fromParsedTrace(result.parsedTrace),
126128
matchingInsight,
127129
);
128130
return {output: formatter.formatInsight()};

tests/tools/performance.test.js.snapshot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ This insight is used to analyze the time spent that contributed to the final LCP
66

77
## Detailed analysis:
88
The Largest Contentful Paint (LCP) time for this navigation was 129 ms.
9-
The LCP element is an image fetched from \`https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg\`.
9+
The LCP element is an image fetched from https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg (eventKey: s-1314).
1010
## LCP resource network request: https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg
11+
eventKey: s-1314
1112
Timings:
1213
- Queued at: 41 ms
1314
- Request sent at: 47 ms
@@ -55,7 +56,7 @@ Bounds: {min: 122410994891, max: 122416385853}
5556
CPU throttling: none
5657
Network throttling: none
5758
Metrics (lab / observed):
58-
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100)
59+
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100), nodeId: 7
5960
- LCP breakdown:
6061
- TTFB: 8 ms, bounds: {min: 122410996889, max: 122411004828}
6162
- Load delay: 33 ms, bounds: {min: 122411004828, max: 122411037986}

tests/trace-processing/parse.test.js.snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bounds: {min: 122410994891, max: 122416385853}
44
CPU throttling: none
55
Network throttling: none
66
Metrics (lab / observed):
7-
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100)
7+
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100), nodeId: 7
88
- LCP breakdown:
99
- TTFB: 8 ms, bounds: {min: 122410996889, max: 122411004828}
1010
- Load delay: 33 ms, bounds: {min: 122411004828, max: 122411037986}

0 commit comments

Comments
 (0)