Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wayfair-incubator/racepoint
https://github.com/wayfair-incubator/racepoint
hacktoberfest
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/wayfair-incubator/racepoint
- Owner: wayfair-incubator
- License: mit
- Created: 2022-01-19T19:06:05.000Z (almost 3 years ago)
- Default Branch: development
- Last Pushed: 2023-09-12T19:01:24.000Z (about 1 year ago)
- Last Synced: 2024-04-14T15:05:39.586Z (7 months ago)
- Topics: hacktoberfest
- Language: TypeScript
- Homepage:
- Size: 2.22 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.MD
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Table of Contents
## About The Project
> RacePoint takes its name from the
> [Lighthouse on the 'Knuckles' of Cape Cod](https://www.capecodlighthouses.info/race-point-light/)This utility provides a mechanism to repeatedly profile web pages. The intention
is to gain metrics and feedback on your page _before_ it is in production.
Specifically it captures several [Core Web Vitals](https://web.dev/vitals/) - an
important set of metrics that Wayfair must meet in order to maintain good SEO
scores.The main operation of this tool is the 'Profiler' - given a url on some (e.g.
your) DevVm, it will execute Lighthouse from the command line repeatedly and
save various details about the results. After some number of runs is complete,
the tool will present to the user the mean and standard deviation for the
following metrics:- Speed Index
- First Contentful Paint
- Largest Contentful Paint
- Cumulative Layout Shift
- Max Potential FID
- Total Blocking Time### Built With
- [Google Lighthouse](https://developers.google.com/web/tools/lighthouse)
- [Docker](https://www.docker.com/)
- [Node JS](https://nodejs.org/)
- [Typescript](https://www.typescriptlang.org/)## Getting Started
To get a Racepoint up and running locally, follow these simple steps.
### Prerequisites
The following software is required to use Racepoint:
- Docker version 4.0.0 or later
- npm version 16 or later```sh
npm install npm@latest -g
```- via node version manager
```sh
nvm install 16
```### Installation
1. Clone the repo
```sh
git clone https://github.com/wayfair-incubator/racepoint.git
```2. Navigate to the project folder
```sh
cd racepoint
```3. Build the packages
```sh
npm run build
```4. Build the images
```sh
docker compose build
```5. Run the race command inside a new docker container. Basic usage on an example
URL```sh
docker compose run racepoint race profile http://your-favorite-site.com/ -n 5
```6. Perform a single run and save the results HTML to the current working
directory```sh
docker compose run -v "$(pwd):/rp/results" racepoint race profile http://example.com/ --output-format html
```7. Shut down containers when finished
```sh
docker compose down
```
## Usage
Please note that all modes make use of port 3000 and 443 on your local machine
unless otherwise specified. If you have any existing webservers (e.g. nginx)
this may interfere.Racepoint accepts the following commands and flags:
### Commands
- `profile` - perform a number of Lighthouse runs against a single URL
| Flag | Description |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| --blocked-url-patterns | URLs of requests to block while loading the page. Basic wildcard support using \*. |
| --chrome-flags | Additional comma-delimeted list of Chrome flags for the emulated browser. |
| -d, --device-type | Device type to emulate (default: "mobile") |
| --disable-storage-reset | If set, will preserve the browser cache between runs. |
| --extra-headers | A JSON-encoded string of additional headers to use on during profiling. |
| --include-individual | Will display the results of individual runs to the console |
| -n, --number-runs | Number of Lighthouse runs per URL (default: 1) |
| --output-target | Location to save results (defaults to current directory) |
| --output-format | Save results as CSV, HTML, or both |
| --repository-id | Name of the repository file (default: "lighthouse-runs") |
| -h, --help | Display help for command |### Debug
To enable full console logging, run your race command with the environmental
variable `LOG_LEVEL=debug````sh
LOG_LEVEL=debug race profile http://my-site.com
```## Roadmap
- [ ] CI integration
There are many exciting new features we plan on adding in the future. Stay
tuned!## Contributing
Please see our
[CONTRIBUTING.md](https://github.com/wayfair-incubator/racepoint/blob/main/CONTRIBUTING.md)
for more information about making contributions.