https://github.com/hasithaishere/speed-tester
https://github.com/hasithaishere/speed-tester
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hasithaishere/speed-tester
- Owner: hasithaishere
- Created: 2024-06-19T03:47:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T05:09:53.000Z (almost 2 years ago)
- Last Synced: 2025-02-25T00:36:53.700Z (over 1 year ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Website Speed Check Tool
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.
## Features
- 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.
## Prerequisites
- Node.js and npm must be installed on your machine.
- Basic understanding of Node.js and JavaScript.
## Installation
1. Clone the repository or download the code to your local machine.
2. Navigate to the project directory.
3. Install the required dependencies by running:
```bash
npm install puppeteer csv-writer
```
## Usage
To run the website speed check tool:
```bash
node full-page-load-check.js [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).
## Example
To check the performance of https://example.com 5 times:
```bash
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.
## Output
- 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:
1. TRY: The run number.
2. FULL_PAGE_LOAD_TIME (s): The time taken for the full page to load, in seconds.
3. TIMESTAMP: The time when the check was performed.
## Dependencies
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.
## Example Output
A typical row in the CSV file might look like this:
```python
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
```