From 84209b97a4dc827bacdb3fee643bdaed7e899621 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 8 Dec 2020 19:49:13 +0100 Subject: [PATCH] New Browsertime 11 alpha (#3201) --- .../sitespeed.io/configure-metrics/index.md | 1 - docs/examples/index.md | 12 ----- lib/plugins/browsertime/aggregator.js | 2 +- .../browsertime/default/metricsPageSummary.js | 1 - .../browsertime/default/metricsSummary.js | 1 - lib/plugins/html/metricHelper.js | 18 +++---- lib/plugins/html/setup/detailed.js | 5 +- lib/plugins/html/templates/help.pug | 3 -- .../html/templates/url/metrics/index.pug | 4 -- .../html/templates/url/summary/summaryBox.pug | 2 +- lib/plugins/influxdb/data-generator.js | 1 - lib/plugins/slack/attachements.js | 8 --- lib/plugins/text/textBuilder.js | 3 -- npm-shrinkwrap.json | 52 +++++++++---------- package.json | 2 +- test/fixtures/coach.run-0.json | 1 - 16 files changed, 39 insertions(+), 77 deletions(-) diff --git a/docs/documentation/sitespeed.io/configure-metrics/index.md b/docs/documentation/sitespeed.io/configure-metrics/index.md index 4aab62c4b..0bc6c9f7d 100644 --- a/docs/documentation/sitespeed.io/configure-metrics/index.md +++ b/docs/documentation/sitespeed.io/configure-metrics/index.md @@ -43,7 +43,6 @@ The file will look something like this: ~~~ browsertime.pageSummary.statistics.timings.timings -browsertime.pageSummary.statistics.timings.rumSpeedIndex browsertime.pageSummary.statistics.timings.fullyLoaded browsertime.pageSummary.statistics.timings.firstPaint browsertime.pageSummary.statistics.timings.userTimings diff --git a/docs/examples/index.md b/docs/examples/index.md index f8802194f..110b61bee 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -109,7 +109,6 @@ It will generate a HAR file, a video and a browsertime.json that hold all the me "first-contentful-paint": 465, "first-paint": 465 }, - "rumSpeedIndex": 469, "userTimings": { "marks": [], "measures": [] @@ -528,16 +527,6 @@ It will generate a HAR file, a video and a browsertime.json that hold all the me "p99": 465, "max": 465 } - }, - "rumSpeedIndex": { - "median": 469, - "mean": 469, - "mdev": 0, - "min": 469, - "p10": 469, - "p90": 469, - "p99": 469, - "max": 469 } }, "visualMetrics": { @@ -1565,7 +1554,6 @@ And it will generate a JSON that looks something like this: "responseEnd": 202, "responseStart": 199 }, - "rumSpeedIndex": 271.0001468658447, "timings": { "backEndTime": 199, "domContentLoadedTime": 220, diff --git a/lib/plugins/browsertime/aggregator.js b/lib/plugins/browsertime/aggregator.js index 45387e107..f8c2963c2 100644 --- a/lib/plugins/browsertime/aggregator.js +++ b/lib/plugins/browsertime/aggregator.js @@ -3,7 +3,7 @@ const forEach = require('lodash.foreach'), statsHelpers = require('../../support/statsHelpers'); -const timings = ['firstPaint', 'rumSpeedIndex', 'timeToDomContentFlushed']; +const timings = ['firstPaint', 'timeToDomContentFlushed']; module.exports = { statsPerType: {}, diff --git a/lib/plugins/browsertime/default/metricsPageSummary.js b/lib/plugins/browsertime/default/metricsPageSummary.js index 8c923f9c0..9c3baadcd 100644 --- a/lib/plugins/browsertime/default/metricsPageSummary.js +++ b/lib/plugins/browsertime/default/metricsPageSummary.js @@ -2,7 +2,6 @@ module.exports = [ 'statistics.timings.pageTimings', - 'statistics.timings.rumSpeedIndex', 'statistics.timings.fullyLoaded', 'statistics.timings.firstPaint', 'statistics.timings.timeToDomContentFlushed', diff --git a/lib/plugins/browsertime/default/metricsSummary.js b/lib/plugins/browsertime/default/metricsSummary.js index 7ee953a55..fb2bcd564 100644 --- a/lib/plugins/browsertime/default/metricsSummary.js +++ b/lib/plugins/browsertime/default/metricsSummary.js @@ -2,7 +2,6 @@ module.exports = [ 'firstPaint', - 'rumSpeedIndex', 'timeToDomContentFlushed', 'fullyLoaded', 'pageTimings', diff --git a/lib/plugins/html/metricHelper.js b/lib/plugins/html/metricHelper.js index b990ad5c1..25e762a73 100644 --- a/lib/plugins/html/metricHelper.js +++ b/lib/plugins/html/metricHelper.js @@ -10,9 +10,9 @@ module.exports = { pageInfo, 'data.browsertime.pageSummary.statistics.visualMetrics.SpeedIndex.median' ); - const rumSpeedIndexMedian = get( + const loadEventEndMedian = get( pageInfo, - 'data.browsertime.pageSummary.statistics.timings.rumSpeedIndex.median' + 'data.browsertime.pageSummary.statistics.timings.loadEventEnd.median' ); if (speedIndexMedian) { for (let run of runs) { @@ -25,16 +25,16 @@ module.exports = { }; } } - } else if (rumSpeedIndexMedian) { + } else if (loadEventEndMedian) { for (let rumRuns of runs) { // make sure we run Browsertime for that run = 3 runs WPT and 2 runs BT if ( rumRuns.data.browsertime && - rumSpeedIndexMedian === - rumRuns.data.browsertime.run.timings.rumSpeedIndex + loadEventEndMedian === + rumRuns.data.browsertime.run.timings.loadEventEnd ) { return { - name: 'RUMSpeedIndex', + name: 'LoadEventEnd', runIndex: rumRuns.runIndex + 1 }; } @@ -56,7 +56,7 @@ module.exports = { Visual Complete 85%: ${visualMetrics.VisualComplete85}, Last Visual Change: ${visualMetrics.LastVisualChange}`; } else if (timings) { - return `RUMSpeedIndex: ${timings.rumSpeedIndex}`; + return `Load Event End: ${timings.loadEventEnd}`; } else { return ''; } @@ -78,8 +78,8 @@ module.exports = { Median Visual Complete 85%: ${visualMetrics.VisualComplete85.median}, Median Last Visual Change: ${visualMetrics.LastVisualChange.median}`; } else if (timings) { - return timings.rumSpeedIndex - ? `Median RUMSpeedIndex: ${timings.rumSpeedIndex.median}` + return timings.loadEventEnd + ? `Median LoadEventEnd: ${timings.loadEventEnd.median}` : '' + timings.fullyLoaded ? `Median Fully loaded: ${timings.fullyLoaded.median}` : ''; diff --git a/lib/plugins/html/setup/detailed.js b/lib/plugins/html/setup/detailed.js index 4ac878b99..5346720fc 100644 --- a/lib/plugins/html/setup/detailed.js +++ b/lib/plugins/html/setup/detailed.js @@ -110,10 +110,7 @@ module.exports = function(data) { if (browsertime) { const summary = browsertime.summary; - rows.push( - row(summary.rumSpeedIndex, 'RUMSpeed Index', 'rumSpeedIndex', h.time.ms), - row(summary.firstPaint, 'First Paint', 'firstPaint', h.time.ms) - ); + rows.push(row(summary.firstPaint, 'First Paint', 'firstPaint', h.time.ms)); if (summary.timings) { rows.push( diff --git a/lib/plugins/html/templates/help.pug b/lib/plugins/html/templates/help.pug index 4942d8309..32d08e914 100644 --- a/lib/plugins/html/templates/help.pug +++ b/lib/plugins/html/templates/help.pug @@ -132,9 +132,6 @@ block content h5(id='Logo') Logo p The time when the logo (configured with --scriptInput.visualElements) within the viewport has finished painted at the final position on the screen. Calculated by analysing a video. - h5(id='rumSpeedIndex') RUM-SpeedIndex - p A browser version also created by Pat Meenan that calculates the SpeedIndex measurements using Resource Timings. It is not as perfect as Speed Index but a good start. - h5(id='imageSizePerPage') Image transfer size per page p The size of images per page. diff --git a/lib/plugins/html/templates/url/metrics/index.pug b/lib/plugins/html/templates/url/metrics/index.pug index 32cd5aaf3..436195dad 100644 --- a/lib/plugins/html/templates/url/metrics/index.pug +++ b/lib/plugins/html/templates/url/metrics/index.pug @@ -118,10 +118,6 @@ if browsertime td a(href=baseHelpURL + 'timeToFirstInteractive') Time To First Interactive td.number #{h.time.ms(timings.timeToFirstInteractive.toFixed(0))} - tr - td - a(href=baseHelpURL + 'rumSpeedIndex') RUM Speed Index - td.number #{h.time.ms(timings.rumSpeedIndex.toFixed(0))} tr td a(href=baseHelpURL + 'loadEventEnd') Load Event End diff --git a/lib/plugins/html/templates/url/summary/summaryBox.pug b/lib/plugins/html/templates/url/summary/summaryBox.pug index 1f16e9c8f..b9c0277f1 100644 --- a/lib/plugins/html/templates/url/summary/summaryBox.pug +++ b/lib/plugins/html/templates/url/summary/summaryBox.pug @@ -46,7 +46,7 @@ mixin getRow(name, object, path, runPath, metric, f) if btStatistics h2 Timings Summary - - timingMetrics = ['firstPaint', 'loadEventEnd','rumSpeedIndex'] + - timingMetrics = ['firstPaint', 'loadEventEnd'] .responsive table thead diff --git a/lib/plugins/influxdb/data-generator.js b/lib/plugins/influxdb/data-generator.js index 6cd85c271..6c6466b6c 100644 --- a/lib/plugins/influxdb/data-generator.js +++ b/lib/plugins/influxdb/data-generator.js @@ -111,7 +111,6 @@ class InfluxDBDataGenerator { tags.timings = keyArray[0]; } else if (type === 'browsertime.pageSummary') { // statistics.timings.pageTimings.backEndTime.median - // statistics.timings.rumSpeedIndex.median // statistics.timings.userTimings.marks.logoTime.median // statistics.visualMetrics.SpeedIndex.median tags[keyArray[0]] = keyArray[1]; diff --git a/lib/plugins/slack/attachements.js b/lib/plugins/slack/attachements.js index a15cdeca1..d7c8f91b9 100644 --- a/lib/plugins/slack/attachements.js +++ b/lib/plugins/slack/attachements.js @@ -82,14 +82,6 @@ module.exports = function( ), f: h.time.ms }, - rumSpeedIndex: { - name: 'RUM Speed Index', - metric: get( - base.browsertime, - 'pageSummary.statistics.timings.rumSpeedIndex' - ), - f: h.time.ms - }, coachScore: { name: 'Coach score', metric: get(base.coach, 'pageSummary.advice.performance.score'), diff --git a/lib/plugins/text/textBuilder.js b/lib/plugins/text/textBuilder.js index b0015b112..b6edf943a 100644 --- a/lib/plugins/text/textBuilder.js +++ b/lib/plugins/text/textBuilder.js @@ -85,9 +85,6 @@ module.exports = { size = `${val}`; } else if (/total requests/i.test(b.name)) { reqs = `${val} reqs`; - } else if (b.url === 'rumSpeedIndex') { - name = abbr(b.name); - rum = color.bold(`${name}: ${val}`); } }); lines.push(drab('Score: ') + scores.reverse().join(', ')); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4ba5de1e9..265fc4b8f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -110,9 +110,9 @@ }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "requires": { "ms": "^2.1.1" } @@ -660,9 +660,9 @@ }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { "ms": "2.1.2" } @@ -723,9 +723,9 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, "@types/node": { - "version": "14.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.8.tgz", - "integrity": "sha512-z/5Yd59dCKI5kbxauAJgw6dLPzW+TNOItNE00PkpzNwUIEwdj/Lsqwq94H5DdYBX7C13aRA0CY32BK76+neEUA==" + "version": "14.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.10.tgz", + "integrity": "sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ==" }, "@ungap/promise-all-settled": { "version": "1.1.2", @@ -1136,9 +1136,9 @@ } }, "browsertime": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-10.9.0.tgz", - "integrity": "sha512-ungRPRy6tJh6KizLwMUS7kJHRVlc1Gf1/3qNmKCtjVgSjeNf3SknWozMa1TEd7nj/cHWsFdJmamamXuW5t4dVQ==", + "version": "11.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-11.0.0-alpha.1.tgz", + "integrity": "sha512-QwlVvAK3yvxyJ0dQafjxyiQd67GoeptsOaG6IoWXjCunCTNpCpS0h9R2TGeAXS5usil2iCUMd2FKrKbO4wQ24Q==", "requires": { "@cypress/xvfb": "1.2.4", "@sitespeed.io/chromedriver": "87.0.4280-20", @@ -2952,13 +2952,13 @@ } }, "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", "optional": true, "requires": { "min-document": "^2.19.0", - "process": "~0.5.1" + "process": "^0.11.10" } }, "globals": { @@ -5029,9 +5029,9 @@ } }, "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "optional": true }, "process-nextick-args": { @@ -7380,9 +7380,9 @@ } }, "ws": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", - "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==" + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz", + "integrity": "sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ==" }, "xdg-basedir": { "version": "4.0.0", @@ -7390,12 +7390,12 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, "xhr": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", - "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", "optional": true, "requires": { - "global": "~4.3.0", + "global": "~4.4.0", "is-function": "^1.0.1", "parse-headers": "^2.0.0", "xtend": "^4.0.0" diff --git a/package.json b/package.json index bb91e86dc..3560af186 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@tgwf/co2": "0.6.1", "aws-sdk": "2.784.0", "axe-core": "4.0.2", - "browsertime": "10.9.0", + "browsertime": "11.0.0-alpha.1", "coach-core": "6.0.0-beta.2", "cli-color": "2.0.0", "concurrent-queue": "7.0.2", diff --git a/test/fixtures/coach.run-0.json b/test/fixtures/coach.run-0.json index 16e58a742..80cf4cc8f 100644 --- a/test/fixtures/coach.run-0.json +++ b/test/fixtures/coach.run-0.json @@ -631,7 +631,6 @@ "loadEventStart": 2453, "loadEventEnd": 2453 }, - "rumSpeedIndex": 2005.3347735577977, "timings": { "domainLookupTime": 0, "redirectionTime": 261,