File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ async function captureMultipleScreenshots() {
2323 try {
2424 const data = fs . readFileSync ( OUTPUT_JSON , 'utf8' ) ;
2525 existingJson = JSON . parse ( data ) ;
26- } catch ( e ) {
26+ } catch {
2727 // ignore
2828 }
2929
@@ -91,6 +91,14 @@ async function captureMultipleScreenshots() {
9191 const lcpScore =
9292 pagespeedOutput ?. lighthouseResult ?. audits ?. [ 'largest-contentful-paint' ] ?. score ;
9393
94+ const loadExpMetrics = pagespeedOutput . loadingExperience ?. metrics ;
95+ // ms score of the 75th percentile of the page users
96+ const inpMs = loadExpMetrics ?. INTERACTION_TO_NEXT_PAINT ?. percentile ;
97+ // no unit, less than 0.1 is good
98+ const clsScore = loadExpMetrics ?. CUMULATIVE_LAYOUT_SHIFT_SCORE ?. percentile / 100 ;
99+ // not core but interesting
100+ const ttfbMs = loadExpMetrics ?. EXPERIMENTAL_TIME_TO_FIRST_BYTE ?. percentile ;
101+
94102 const ttiDisplay = pagespeedOutput ?. lighthouseResult ?. audits ?. interactive ?. displayValue ;
95103 const ttiScore = pagespeedOutput ?. lighthouseResult ?. audits ?. interactive ?. score ;
96104
@@ -99,6 +107,9 @@ async function captureMultipleScreenshots() {
99107 const score = pagespeedOutput ?. lighthouseResult ?. categories ?. performance ?. score ;
100108 const perf = {
101109 score,
110+ inpMs,
111+ clsScore,
112+ ttfbMs,
102113 fcpDisplay,
103114 fcpScore,
104115 lcpDisplay,
You can’t perform that action at this time.
0 commit comments