Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

web-perf-test

0.1.2 • Public • Published

web-perf-test: Web performance measuring tool using Puppeteer

This is a pretty simple CLI tool for measuring the initial page loading time of a web site, using Puppeteer.

It measures until the timing data is considered stable and prints out the statistics together with a box plot.

Installation

$ npm install -g web-perf-test

Usage

usage: web-perf-test [-h] [-v] [--show-chrome] url

Automated web performance test using Puppeteer.

Positional arguments:
  url            URL of the page to measure

Optional arguments:
  -h, --help     Show this help message and exit.
  -v, --version  Show program's version number and exit.
  --show-chrome  Make the Chromium browser visible

What is measured?

web-perf-test loads the given page using Puppeteer and evaluates the loading time using the PerformanceTiming data in the browser.

More specifically, it calculates loadEventEnd - requestStart. loadEventEnd represents the moment when the load event is completed, and requestStart represents the moment when the browser sent the request to obtain the actual document.

How are the data measured?

The loading time is measured at least 25 times. After that, the tool checks if the data is stable. If it is not stable, keep measuring until it becomes stable or the total number of measurements is 50.

The data is considered stable when the median is stable, which means that its interquartile range (IQR) is <= 1% of the median. The idea is borrowed from the Rules of Thumb for HTTP/2 Push document.

Install

npm i web-perf-test

DownloadsWeekly Downloads

1

Version

0.1.2

License

Apache-2.0

Last publish

Collaborators

  • avatar