Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"chrome-devtools-frontend": "1.0.1516909",
"chrome-devtools-frontend": "1.0.1520139",
"eslint": "^9.35.0",
"eslint-plugin-import": "^2.32.0",
"eslint-import-resolver-typescript": "^4.4.4",
Expand Down
10 changes: 6 additions & 4 deletions src/trace-processing/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ export async function parseRawTraceBuffer(
}

export function getTraceSummary(result: TraceResult): string {
const focus = AgentFocus.full(result.parsedTrace);
const serializer = new TraceEngine.EventsSerializer.EventsSerializer();
const formatter = new PerformanceTraceFormatter(focus, serializer);
const focus = AgentFocus.fromParsedTrace(result.parsedTrace);
const formatter = new PerformanceTraceFormatter(
focus,
PerformanceInsightFormatter.create,
);
const output = formatter.formatTraceSummary();
return output;
}
Expand Down Expand Up @@ -122,7 +124,7 @@ export function getInsightOutput(
}

const formatter = new PerformanceInsightFormatter(
result.parsedTrace,
AgentFocus.fromParsedTrace(result.parsedTrace),
matchingInsight,
);
return {output: formatter.formatInsight()};
Expand Down
5 changes: 3 additions & 2 deletions tests/tools/performance.test.js.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ This insight is used to analyze the time spent that contributed to the final LCP

## Detailed analysis:
The Largest Contentful Paint (LCP) time for this navigation was 129 ms.
The LCP element is an image fetched from \`https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg\`.
The LCP element is an image fetched from https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg (eventKey: s-1314).
## LCP resource network request: https://web-dev.imgix.net/image/kheDArv5csY6rvQUJDbWRscckLr1/4i7JstVZvgTFk9dxCe4a.svg
eventKey: s-1314
Timings:
- Queued at: 41 ms
- Request sent at: 47 ms
Expand Down Expand Up @@ -55,7 +56,7 @@ Bounds: {min: 122410994891, max: 122416385853}
CPU throttling: none
Network throttling: none
Metrics (lab / observed):
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100)
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100), nodeId: 7
- LCP breakdown:
- TTFB: 8 ms, bounds: {min: 122410996889, max: 122411004828}
- Load delay: 33 ms, bounds: {min: 122411004828, max: 122411037986}
Expand Down
2 changes: 1 addition & 1 deletion tests/trace-processing/parse.test.js.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bounds: {min: 122410994891, max: 122416385853}
CPU throttling: none
Network throttling: none
Metrics (lab / observed):
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100)
- LCP: 129 ms, event: (eventKey: r-6063, ts: 122411126100), nodeId: 7
- LCP breakdown:
- TTFB: 8 ms, bounds: {min: 122410996889, max: 122411004828}
- Load delay: 33 ms, bounds: {min: 122411004828, max: 122411037986}
Expand Down
Loading