Progressive web metrics at your fingertipz
In favour of better support and many cool features of:
PWMetrics
Progressive web metrics at your fingertipz.
CLI tool and lib to gather performance metrics via Lighthouse.
Documentation on these metrics in the works. If you hit bugs in the metrics collection, report at Lighthouse issues. How to use article
$ yarn global add pwmetrics
# or
$ yarn add --dev pwmetrics…# run pwmetrics with config in package.json
pwmetrics --configpackage.json
...
"pwmetrics": {
"url": "http://example.com/",
// other configuration options
}
...# run pwmetrics with config in pwmetrics-config.js
pwmetrics --config=pwmetrics-config.jspwmetrics-config.js
module.exports = {
url: 'http://example.com/',
// other configuration options. Read _All available configuration options_
}pwmetrics-config.js
…Recipes for using with CI
# run pwmetrics with config in package.json
pwmetrics --expectationspackage.json
...
"pwmetrics": {
"url": "http://example.com/",
"expectations": {
...
}
}
...# run pwmetrics with config in pwmetrics-config.js
pwmetrics --expectations --config=pwmetrics-config.jsSubmit results to Google Sheets
Instructions:
sheets.options.spreadsheetId property.client_secret and put it into the config as value of clientSecret property.# run pwmetrics with config in package.json
pwmetrics --submit# run pwmetrics with config in pwmetrics-config.js
pwmetrics --submit --config=pwmetrics-config.jspwmetrics-config.js
module.exports = {
'url': 'http://example.com/',
'sheets': {
...
},
'clientSecret': {
...
}
}Upload Lighthouse traces to Google Drive
Instructions:
client_secret and put it into the config as value of clientSecret property.# run pwmetrics with config in package.json
pwmetrics --upload# run pwmetrics with config in pwmetrics-config.js
pwmetrics --upload --config=pwmetrics-config.jspwmetrics-config.js
module.exports = {
'url': 'http://example.com/',
'clientSecret': {
...
}
}Show Lighthouse traces in timeline-viewer.
Required to use
uploadflag
timeline-viewer - Shareable URLs for your Chrome DevTools Timeline traces.
# run pwmetrics with config in package.json
pwmetrics --upload --view# run pwmetrics with config in your-own-file.js
pwmetrics --upload --view --config=your-own-file.jspwmetrics-config.js
module.exports = {
'url': 'http://example.com/',
'clientSecret': {
...
}
}All metrics now are stored in separate constant object located in pwmetrics/lib/metrics/metrics;
// lib/metrics/metrics.ts
{
METRICS: {
TTFCP: 'firstContentfulPaint',
TTLCP: 'largestContentfulPaint',
TBT: 'totalBlockingTime',
TTI: 'interactive',
SI: 'speedIndex'
}
}Read article Performance metrics. What’s this all about? which is decoding this metrics.
… Option
Type
Default
Description
flags*
Object{ runs: 1, submit: false, upload: false, view: false, expectations: false, disableCpuThrottling: false, chromeFlags: '' }
Feature flags
expectations
Object
{}
See Defining expectations above.
sheets
Object
{}
See Defining submit above.
clientSecret
Object
{}
Client secrete data generated by Google API console.
To setup Google Developer project and get credentials apply everything in step 1 here.*pwmetrics supports all flags from Lighthouse. See here for the complete list.
Apache 2.0. Google Inc.
No open issues yet, or sync has not completed.