Just now we released k6 version 0.18, which includes substantial changes from 0.17. I wanted to tell you a bit about those, and also look back at what has happened in the project during 2017.
Now as we’re approaching the end of 2017, I've been thinking about writing a little retrospective on what has happened during the year (and publish it before everyone leaves for christmas and new year's holidays).
As we just released k6 version 0.18.0 - our biggest release yet! - it seemed like a good time to do this retrospective. It means I can add some truly new information to the article, and not just rehash what happened months back in time.
To sum up 2017 though, we're incredibly happy as k6 has really taken off since we released it early this year, with tons of acknowledgement from Github users (over 3,000 stars in such a short time!) and an active community that is discussing k6 daily in the k6.io Slack channels.
We already have a dozen external code contributors also, who have helped us build the things you see mentioned below. I'd like to send a big thank you to our fantastic contributors!
So - this is the biggest k6 release ever, containing a ton of new things! For a more complete CHANGELOG and description of what 0.18 contains, please see https://github.com/loadimpact/k6/releases/tag/v0.18.0
- jQuery 4 all!! (PR #197)This was the largest change in terms of amount of code: we finally merged the great work of @mitnuh. His patch makes all of the jQuery API available to k6 scripts! See https://k6.io/docs/k6-html for more details.
- HTTP cookie manipulation API (PR #323)You can now more easily manipulate HTTP cookies, either per-request or set globally persistent cookies that get sent with every HTTP request.
- New k6/encoding module implementing base64 encoding/decoding (PR #341)
- New and leaner Docker image based on Alpine Linux (PR #337)
- CLI rewrite (Issue #110)Refactored the whole CLI and swapped out the old CLI component urfave/cli for https://github.com/spf13/cobra. The result is a smarter and more user-friendly CLI, with better help pages, less dependent on flag/option positions on the command line, and where you can also specify any option using environment variables (e.g. the environment variable "K6_VUS” can be used to configure VU level).
- http.batch() now accepts objects also (Issue #295)
- Much faster loading of external ES5 libraries (Issue #212)
- Extended TLS info in HTTP responses (PR #322)
And a bunch of bugfixes and improvements:
- Follow redirects fixed (PR #324)
- The iterations metric wasn’t exported properly (Issue #313)
- Sporadic errors at the end of tests (Issue #358)
- Incorrect scaling/failed requests at the start of a test when using stages (Issue #326)
- k6/ws: The closeevent sometimes wouldn’t be emitted (Issue #329)
- k6/ws: Respond to pings with pongs as per the Websocket protocol specification (PR #330)
- k6/ws: Missing metrics at the end of a test (Issue #333)
- Cloud: Anonymous tests with -o cloud now show correct URLs (PR #348)
- Cloud: more useful error messages from tests with -o cloud
Many of the above changes have resulted in changes or additions to the official documentation also, of course. Check it out at https://k6.io/docs
During the whole of 2017 we have managed to get about 25 releases out the door. At the start of the year, the releases were smaller and more frequent though. Lately, the cadence have been around one release per month up until 0.18, which took us two months to get out the door due to its size.
We’ll strive to get back to a faster tempo, and we have been discussing perhaps starting to release at set intervals instead of making releases feature-dependent. If you have an opinion on things like this you’re welcome to discuss it with us in our Slack channels.
Some cool stuff coming up in the near future:
- Setup and teardown methods (Issue #194)Will make it possible to run code prior to the actual test starting, and after the test has finished.
- Controlling requests/second (Issue #211)Will make it possible to test with fixed RPS rates.
- Clustering and distributed execution (Issue #140) A much-asked-for feature that allows you to control and run multiple k6 instances in a single test (just like you can do with the Load Impact cloud option).
There are a lot more things on the horizon though. Please check out our new Github projects page, where we publish the planned road map: https://github.com/loadimpact/k6/projects/2
Below is a short retrospective/summary of all releases in 2017, in CHANGELOG format.
Note that refactoring, improvements and bugfixes are (mostly) not listed below, or the list would be too long. Those types of changes, however, actually comprise the majority of code commits to the repo in any release. Some releases below were made primarily because some nasty bug was fixed, which means their entries below will look a bit empty.
- TLS client certificate support
- Memory usage optimizations
- JS function call optimizations
- TLS configuration options
- HMAC support
- Improved display of check results
- More consistent display of percentiles
- HTTP protocol version (1/2) tag on metrics
- Groundwork for cloud execution and clustering
- Websocket support
- k6 login influxdb
- http.url tag for interpolating templated URLs
- Test config archive functionality
- timeout option for http requests
- userAgent option for http requests
- Request errors are no longer thrown, but logged as warnings
- Support for outputting results to Load Impact Insights
- k6/crypto module
In the releases before 0.14.0 we did not write proper CHANGELOG information in the release notes, so from here on I have had to scan all the individual commit messages in order to figure out what things went into what release - tedious and error-prone, so take the information below with a grain of salt. I may have listed some feature/whatever as belonging to release X when it was in fact included in the next release (or the previous).
- New & faster JS runner
- Lots of refactoring
- Per-VU connection pools
- Track bandwidth usage
- Print load-time JS errors with stack traces
- Disabled source maps for faster Babel runs
- Debug log timing information
- Load files from disk, URLs, CDNJS and Github
- k6/html module
- More extensive suite of sample scripts
- File importing
- fail() function to throw errors
- --quiet flag to opt into non-TTY behavior
- Better ASCII art!
- --stage flag
- Added http.batch()
- Added development setup instructions
- Expose effective URL in HTTP response
- --no-color flag
- ASCII art logo and colored output!
- In-process ES6 compiler, dropping Node dependency!
- Use minified babel builds, saves memory
- Auto-create influxdb db if it doesn’t exist
- Read script from stdin
- Added CONTRIBUTING and CODE_OF_CONDUCT docs
- Red/green colors for pass/fail icons
- VU and ITER
- HTTP CONNECT, OPTIONS and TRACE support
- Back off on errors
- Tags on checks
- --insecure-skip-tls-verify flag
- Read files from scripts
- Environment variable support through __ENV
- Usage reports
- Checks emitted as metrics
- Default to 1 iteration
- Auto-detect input type (script/URL)
- Script sample using submetrics
- You can specify tags for HTTP requests
- Thresholds on submetrics, filtered by tags
- Added internal metrics (vus, vus_max, iterations, etc)
- New script samples
- p() function for trend metric thresholds
- Thresholds specified directly in Options
- k6 pause/resume
- k6 scale
- k6 stats
- k6 status
- v2 groups API
- Dockerfile for preconfigured k6+InfluxDB+Grafana image