Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(trace-engine-result): disable invalidations handler #16142

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 5 additions & 2 deletions core/computed/metrics/lantern-first-contentful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class LanternFirstContentfulPaint extends Lantern.Metrics.FirstContentfulPaint {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
return this.compute(await getComputationDataParams(data, context), extras)
.catch(lanternErrorAdapter);
try {
return this.compute(await getComputationDataParams(data, context), extras);
adamraine marked this conversation as resolved.
Show resolved Hide resolved
} catch (err) {
lanternErrorAdapter(err);
}
}

/**
Expand Down
7 changes: 5 additions & 2 deletions core/computed/metrics/lantern-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class LanternInteractive extends Lantern.Metrics.Interactive {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
return this.compute(await getComputationDataParams(data, context), extras)
.catch(lanternErrorAdapter);
try {
return this.compute(await getComputationDataParams(data, context), extras);
} catch (err) {
lanternErrorAdapter(err);
}
}

/**
Expand Down
7 changes: 5 additions & 2 deletions core/computed/metrics/lantern-largest-contentful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class LanternLargestContentfulPaint extends Lantern.Metrics.LargestContentfulPai
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
return this.compute(await getComputationDataParams(data, context), extras)
.catch(lanternErrorAdapter);
try {
return this.compute(await getComputationDataParams(data, context), extras);
} catch (err) {
lanternErrorAdapter(err);
}
}

/**
Expand Down
7 changes: 5 additions & 2 deletions core/computed/metrics/lantern-max-potential-fid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class LanternMaxPotentialFID extends Lantern.Metrics.MaxPotentialFID {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
return this.compute(await getComputationDataParams(data, context), extras)
.catch(lanternErrorAdapter);
try {
return this.compute(await getComputationDataParams(data, context), extras);
} catch (err) {
lanternErrorAdapter(err);
}
}

/**
Expand Down
7 changes: 5 additions & 2 deletions core/computed/metrics/lantern-speed-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ class LanternSpeedIndex extends Lantern.Metrics.SpeedIndex {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
return this.compute(await getComputationDataParams(data, context), extras)
.catch(lanternErrorAdapter);
try {
return this.compute(await getComputationDataParams(data, context), extras);
} catch (err) {
lanternErrorAdapter(err);
}
}

/**
Expand Down
11 changes: 10 additions & 1 deletion core/computed/trace-engine-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ class TraceEngineResult {
* @return {Promise<LH.Artifacts.TraceEngineResult>}
*/
static async runTraceEngine(traceEvents) {
const processor = TraceEngine.TraceProcessor.createWithAllHandlers();
const traceHandlers = TraceEngine.TraceHandlers;

// @ts-expect-error Temporarily disable this handler
// It's not currently used anywhere in trace engine insights or Lighthouse.
// TODO: Re-enable this when its memory usage is improved in the trace engine
// https://github.com/GoogleChrome/lighthouse/issues/16111
delete traceHandlers.Invalidations;

const processor = new TraceEngine.TraceProcessor(traceHandlers);

// eslint-disable-next-line max-len
await processor.parse(/** @type {import('@paulirish/trace_engine').Types.TraceEvents.TraceEventData[]} */ (
traceEvents
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"webtreemap-cdt": "^3.2.1"
},
"dependencies": {
"@paulirish/trace_engine": "0.0.28",
"@paulirish/trace_engine": "0.0.30",
"@sentry/node": "^6.17.4",
"axe-core": "^4.9.1",
"chrome-launcher": "^1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion types/artifacts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ declare module Artifacts {

interface TraceEngineResult {
data: TraceEngine.Handlers.Types.TraceParseData;
insights: TraceEngine.Insights.Types.TraceInsightData<typeof TraceEngine.Handlers.ModelHandlers>;
insights: TraceEngine.Insights.Types.TraceInsightData;
}

interface TraceEngineRootCauses {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1080,10 +1080,10 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"

"@paulirish/trace_engine@0.0.28":
version "0.0.28"
resolved "https://registry.yarnpkg.com/@paulirish/trace_engine/-/trace_engine-0.0.28.tgz#9c7163c68fc697a3c39638248aa8f143eb188927"
integrity sha512-hxeqhny/jggy3y3yEUE/91UQmNREjoebaYlggWNTtX1ZFdIXJ4ea8MSMlO+dc1oWcnKHGQzdU3+Mhl01ZEuU0w==
"@paulirish/trace_engine@0.0.30":
version "0.0.30"
resolved "https://registry.yarnpkg.com/@paulirish/trace_engine/-/trace_engine-0.0.30.tgz#89b84129c6b66a5582873c1062f4414e2d81b930"
integrity sha512-26Kr4gA2EGV6zq5kaQawy7jah6ih3XN2bDQti5/HTdFhIetbbDVgwxVnH0hCMe0vD1yMk5SCCQyka3e0cR7GhA==

"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
Expand Down
Loading