Sign inSign up

garie/lighthouse

By garie

•Updated over 7 years ago

Lighthouse Garie plugin. Polls websites to checkout performance metrics also supports webhooks.

Image
1

10K+

garie/lighthouse repository overview

https://github.com/boyney123/garie-lighthouse⁠

Highlights

  • Poll for lighthouse performance metrics on any website and stores the data into InfluxDB
  • Webhook support
  • Understand your performance metrics with recommened improvements thanks to lighthouse reports
  • View all historic lighthouse reports.
  • Setup within minutes

⁠Overview of garie-lighthouse

Garie-lighthouse was developed as a plugin for the Garie⁠ Architecture.

Garie⁠ is an out the box web performance toolkit, and garie-lighthouse is a plugin that generates and stores lighthouse data into InfluxDB.

Garie-lighthouse can also be run outside the Garie environment and run as standalone.

If your interested in an out the box solution that supports multiple performance tools like lighthouse, google-speed-insight and web-page-test then checkout Garie⁠.

If you want to run garie-lighthouse standalone you can find out how below.

⁠Getting Started

⁠Prerequisites
  • Docker installed
⁠Running garie-lighthouse

You can get setup with the basics in a few minutes.

First clone the repo.

git clone [email protected]:boyney123/garie-lighthouse.git

Next setup you're config. Edit the lighthouse-config.json and add websites to the list.

{
	"cron": "00 00 */6 * * *",
	"urls": [
		{
			"url": "https://www.comparethemarket.com",
			"report": true
		},
		{
			"url": "https://www.bbc.co.uk",
			"report": true
		},
		{
			"url": "https://www.cnn.com",
			"report": true
		}
	]
}

Once you finished edited your config, lets build our docker image and setup our environment.

docker build -t garie-lighthouse . && docker-compose up

This will build your copy of garie-lighthouse and run the application.

On start garie-lighthouse will start to gather performance metrics for the websites added to the lighthouse-config.json.

⁠Data collected

Lighthouse comes with loads of audits out the box. You can view all metrics in the reports.

Garie-lighthouse filters what data is stored into influxDB and returned in the webhook.

PropertyTypeDescription
performance-scorenumberOverall performance score.
pwa-scorenumberOverall progressive web app score.
accessibility-scorenumberOverall accessibility score.
best-practices-scorenumberOverall best practices score.
seo-scorenumberOverall seo score.
time-to-first-bytenumberNumber of ms to first byte.
firstContentfulPaintnumberNumber of ms to first contentful paint.
firstMeaningfulPaintnumberNumber of ms to first meaningful paint.
interactivenumberNumber of ms to interactive.
firstCPUIdlenumberNumber of ms to CPU idle.
speedIndexnumberGoogle speed index.
estimatedInputLatencynumberInput Latency.
errors-in-consolenumberNumber of errors in the console.
redirectsnumberNumber of redirects.
redirectsnumberNumber of redirects.

⁠Viewing reports

Viewing lighthouse reports is straight forward. Once you have your application running just go to localhost:3000/reports and you should see all the reports lighthouse has generated.

reports reports

If you don't want to generate reports you can turn this off in the lighthouse-config.json by setting report to false.

⁠Webhook

Garie-lighthouse also supports webhooks. You will need to POST to localhost:3000/collect.

Payload

PropertyTypeDescription
urlstring (required)Url to get metrics for.
reportboolean (optional)When set to true a lighthouse report will be generated

Payload Example

{
  "url": "https://www.bbc.co.uk",
  "report": true
}

By default, reports on webhook's are not generated unless you set report to true

⁠lighthouse-config.json

PropertyTypeDescription
cronstring (optional)Cron timer. Supports syntax can be found [here].(https://www.npmjs.com/package/cron⁠)
urlsobject (required)Config for lighthouse. More detail below

urls object

PropertyTypeDescription
urlstring (required)Url to get lighthouse metrics for.
reportboolean (optional)If set to true, lighthouse report will also be generated.

Tag summary

Content type

Image

Digest

Size

243.6 MB

Last updated

over 7 years ago

docker pull garie/lighthouse