Skip to content

Tom-Davidson/pagespeedinsights-collector

Repository files navigation

pagespeedinsights-collector

CircleCI Docker Hub Contributor Covenant

Collect Google's PageSpeed Insights and graph over time.

Installation

  • Sign up for a Pagespeed Insights API Key
  • Edit the values in helm/values.yaml and helm upgrade --install pagespeedinsights-collector ./helm/
  • or use --set to override the default values helm upgrade --install --set APIKey=<yourPageSpeedInsightsAPIKey>,PAGES="https://www.example.com/" pagespeedinsights-collector ./helm/

Running a development environment

  • From your local machine:
    • cp .env.example .env using your API key and list of pages to track.
    • npm install
    • npm run dev:local
    • Open http://localhost:3000/metrics in your browser
  • Via docker:
    • cp .env.example .env using your API key and list of pages to track.
    • docker-compose up
    • Available services:
    • if you make changes to package.json or package-lock.json please rm -Rf ./node_modules/ in order for it to be re-installed from within the container
    • To check for smells using a local installation of sonarcube docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:8.6.1-community to start the local server, set your env vars with SONAR_HOST_URL=http://localhost:9000 SONAR_LOGIN="YOUR_TOKEN_HERE" npm run test:sonar. If you want to stop the local instance of sonarqube run docker stop sonarqube

Running Tests

You might need to install trivy for the security related tests.

  • npm test js unit tests and Dockerfile linting
  • npm run test:dockerfile:security runs security best practice static analysis on the Dockerfile (not on CI currently)

Debugging

  • Direct access to the K8s service: kubectl port-forward deployment/pagespeedinsights-collector 3000:3000

About

Collect Google's PageSpeed Insights and graph over time.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 6