This tool uses Puppeteer to measure the full page load time of a website. It navigates to the specified URL, waits for the page to fully load, and captures performance metrics including the total page load time. The results are saved in a CSV file.
- Measures full page load time, including the time it takes for a React application to become fully interactive.
- Disables browser cache to ensure each test run starts fresh.
- Logs detailed performance metrics and saves them in a CSV file.
- Node.js and npm must be installed on your machine.
- Basic understanding of Node.js and JavaScript.
- Clone the repository or download the code to your local machine.
- Navigate to the project directory.
- Install the required dependencies by running:
npm install puppeteer csv-writer
To run the website speed check tool:
node full-page-load-check.js <URL> [number_of_tries]
- The URL of the website you want to check (required).
- [number_of_tries]: The number of times to run the speed check (optional, default is 10).
To check the performance of https://example.com 5 times:
node full-page-load-check.js https://example.com 5
This will generate a CSV file named -.csv, where is the host part of the URL and is the timestamp of when the test was run.
- The script generates a CSV file with the performance results for each run.
- The CSV file is named using the host of the URL and the current date-time (e.g., site-speed-example-com-2024-06-19T14-30-00.csv).
- Each row in the CSV file contains:
- TRY: The run number.
- FULL_PAGE_LOAD_TIME (s): The time taken for the full page to load, in seconds.
- TIMESTAMP: The time when the check was performed.
The tool uses the following Node.js packages:
- puppeteer: For controlling a headless instance of Chrome to perform the page load test.
- csv-writer: To create and write the results to a CSV file.
A typical row in the CSV file might look like this:
TRY, FULL_PAGE_LOAD_TIME (s), TIMESTAMP
1, 3.45, 2024-06-19T14:30:00.123Z
2, 3.50, 2024-06-19T14:35:00.456Z