Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pwmetrics

> 数据库
Open source

Progressive web metrics at your fingertipz

1.2K stars0 likes0 views
WebsiteGitHub

About

Progressive web metrics at your fingertipz

Deprecated

In favour of better support and many cool features of:

  • Lighthouse CI - is a suite of tools that make continuously running, saving, retrieving, and asserting against Lighthouse results as easy as possible.
  • Lighthouse CI Action - action integrates Lighthouse CI with Github Actions environment. Making it simple to see failed tests, upload results, run jobs in parallel, store secrets, and interpolate env variables.
  • Treo.sh - Page speed monitoring made simple.

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

Install

bash
$ yarn global add pwmetrics
# or
$ yarn add --dev pwmetrics

CLI Usage

…

Defining config

bash
# run pwmetrics with config in package.json
pwmetrics --config

package.json

...
  "pwmetrics": {
    "url": "http://example.com/",
    // other configuration options
  }
...
bash
# run pwmetrics with config in pwmetrics-config.js
pwmetrics --config=pwmetrics-config.js

pwmetrics-config.js

javascript
module.exports = {
  url: 'http://example.com/',
   // other configuration options. Read _All available configuration options_
}

All available configuration options

pwmetrics-config.js

…

Defining expectations

Recipes for using with CI

bash
# run pwmetrics with config in package.json
pwmetrics --expectations

package.json

...
  "pwmetrics": {
    "url": "http://example.com/",
    "expectations": {
      ...
    }
  }
...
bash
# run pwmetrics with config in pwmetrics-config.js
pwmetrics --expectations --config=pwmetrics-config.js

Defining submit

Submit results to Google Sheets

Instructions:

  • Copy this spreadsheet.
  • Copy the ID of the spreadsheet into the config as value of sheets.options.spreadsheetId property.
  • Setup Google Developer project and get credentials. (everything in step 1 here)
  • Take a client_secret and put it into the config as value of clientSecret property.
bash
# run pwmetrics with config in package.json
pwmetrics --submit
bash
# run pwmetrics with config in pwmetrics-config.js
pwmetrics --submit --config=pwmetrics-config.js

pwmetrics-config.js

javascript
module.exports = {
  'url': 'http://example.com/',
  'sheets': {
    ...
  },
  'clientSecret': {
    ...
  }
}

Defining upload

Upload Lighthouse traces to Google Drive

Instructions:

  • Setup Google Developer project and get credentials. (everything in step 1 here)
  • Take a client_secret and put it into the config as value of clientSecret property.
bash
# run pwmetrics with config in package.json
pwmetrics --upload
bash
# run pwmetrics with config in pwmetrics-config.js
pwmetrics --upload --config=pwmetrics-config.js

pwmetrics-config.js

javascript
module.exports = {
  'url': 'http://example.com/',
  'clientSecret': {
    ...
  }
}

View Lighthouse traces in timeline-viewer

Show Lighthouse traces in timeline-viewer.

Required to use upload flag

timeline-viewer - Shareable URLs for your Chrome DevTools Timeline traces.

bash
# run pwmetrics with config in package.json
pwmetrics --upload --view
bash
# run pwmetrics with config in your-own-file.js
pwmetrics --upload --view --config=your-own-file.js

pwmetrics-config.js

javascript
module.exports = {
  'url': 'http://example.com/',
  'clientSecret': {
    ...
  }
}

Available metrics:

All metrics now are stored in separate constant object located in pwmetrics/lib/metrics/metrics;

javascript
// 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.

API

…

Options

  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.

Recipes

  • gulp

License

Apache 2.0. Google Inc.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptlighthousemetricsperformancewebperf

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库