Documentation / Upgrade
- Regular user
- Plugin makers
Upgrading to 6.x from 5.x? There are a couple of important things that have changed that you should read before you do the switch.
As a regular user there are a couple of changes you need to know about. Nothing will break there’s a few configuration changes you should do.
Default 30 fps for the video
In older versions the default frames per second for the video was 60. On cloud services that could be too much, introducing unstable metrics. If you still want to use 60fps you can do that by adding
--videoParams.framerate 60 to your run.
Do a test run with 30fps and check what happens to your Visual Metrics.
We have switched to Graphite 1.x by default (from Graphite 0.x). When Graphite moved to 1.0 they changed how annotations is handled. If you use 0.x version you and send annotations through sitespeed.io you need to add
--graphite.arrayTags false to make it continue to work as before.
Video and Speed Index default in the Docker containers
In the new version we have video and Speed Index turned on by default when you run in our Docker containers. If you want to turn them off add
--video false and
--speedIndex false to your run.
If you don’t use our Docker containers (you should!) and install via npm/yarn, we know use latest LTS of NodeJS 8.9.1 (so you should upgrade your NodeJS version too).
Assets timings with more in details info
For 99.9% of the users this will not change anything but if you are sending assets timings to Graphite/InfluxDB (as we told you not to do) we changed so instead of getting the total time you now get: blocked, dns, connect, send, wait and receive timings #1693.
We have moved the GPSI outside of sitespeed.io and you can find it here. To run in along with sitespeed.io you just follow the instructions how to add a plugin. We moved it outside of sitespeed.io to make the code base cleaner and with the hope that we can find a maintainer who can give it more love.
We have made some changes to plugins to make it possible for plugins to generate HTML and to talk to each other before sitespeed.io starts to test URLs.
No more hooks, say hello to new messages on the queue
In 5.X we relied on hooks for plugins, but we remove them and changed to use messages.
In 6.x your plugin should have an open function (called on startup), processMessage (getting all messages that are passed around in the queue) and close (optional).
We now have three messages sent by the queue:
- sitespeedio.summarize (old message summarize) that tells the plugins that all URLs are analysed and you can now summarise the metrics.
- sitespeedio.render which tells the plugins to render content to disk. The HTML plugin pickup sitespeedio.render, render the HTML and then sends a html.finished message, that then other plugins can pickup.
We changed name of the old message summarize to sitespeedio.summarize.
This means you need to remove your hooks and act on the messages instead.
No generic Datacollector
One of the bad design in the old 5.x code was the DataCollector (generic collector of data). We removed that now and that means each and every plugin needs to collect the data it needs themselves.
The easiest (but a little ugly) way to migrate is to move the old DataCollector code) to your own plugin. The better way is to cherry pick the metrics/data that your plugin needs.
StorageManager API changes
Several parts of the StorageManager API have been updated to fit better together. The following changes may break code written using the 5.x API:
createDirectory(...directoryNames)and takes any number of directory names (which will be joined together) as arguments.
writeData(filename, data)has reversed the order of its arguments. It is now
writeHtml(filename, html)has reversed the order of its arguments. It is now
writeDataForUrl(data, filename, url, subDir)no longer has a fifth argument indicating whether output should be gzipped.
writeHtmlForUrl(html, filename, url)no longer has a fourth argument indicating whether output should be gzipped.
Note that all compression functionality has been removed. If you need compressed output, your plugin should handle gzipping itself. See the
harstorer plugin for an example.