Documentation / GCS

Google Cloud Storage

Set up a GCS bucket

To set up a bucket on GCS you need to have a Google Cloud account.

  • Create an IAM User with the Storage Object Admin role - you need an IAM user to get the key file to be able to upload the result from sitespeed.io.
  • Create a bucket - set up one bucket per server that runs tests (then you are sure there will be no collisions, and it will be easier when you want to remove tests).
  • Configure your bucket for static website hosting - so that you can access the result pages, and make sure you add a bucket policy (for access).
  • Add a lifecycle rule - you want to make sure you remove old result pages/videos/screenshots to save money.

Do you need more help? First dive into the Google Cloud Storage docs, and if that doesn't help, create an issue and we can try to help you.

sitespeed.io configuration

To push the metrics to GCS you need the project id, the service account key file and your bucketname. You get the --gcs.projectID from your Google Cloud Platform project and the --gcs.key from your IAM User. The --gcs.bucketname is the name you picked for your bucket.

Using GCS as server

Running on GCS, you should also set up a URL to your GCS bucket. Make sure that the name of the bucket is the same as the domain name and make the content of the bucket publicly readable with --gcs.public true. Or set up IAM permissions for the bucket. That way the annotation links in Graphite/InfluxDB will appear, and you can go from a result in Grafana to the actual HTML result. That is super useful when you want to understand a regression.

Regardless of whether you have your own domain or not, the --resultBaseURL option needs to be set and to also include the bucket name. Without a domain and a bucket called results, the resultBaseURL will be --resultBaseURL=https://storage.googleapis.com/results.

Extra options you should use

When you push to GCS, there are a couple of extra configurations you should use.

By default the HAR file is bundled in the HTML, because if you run the HTML files locally on your machine, that's the only way they can be loaded. But on GCS you want to separate the HAR and the HTML (it will save space). Do that by adding --html.fetchHARFiles.

Then you want to make sure the HAR files are gzipped (to save even more space): --gzipHAR.

Screenshots are PNG by default, but you probably want them to be JPG: --screenshot.type jpg.

You should also make sure that all the result files (HTML/videos/screenshots) are removed from your local server and only exist on GCS. Add --gcs.removeLocalResult.