k6 v0.26.0 is here! This release contains mostly bug fixes, though it also has several new features and enhancements! They include a new JS compatibility mode option, exporting the end-of-test summary to a JSON report file, speedups to the InfluxDB and JSON outputs,
http.batch() improvements, a brand new CSV output, multiple layered HTTP response body decompression, being able to use
console in the init context, a new optional column in the summary, and Docker improvements!
New features and enhancements!
This adds a way to disable the automatic script transformation by Babel (v6.4.2) and loading of core-js (v2) polyfills, bundled in k6. With the new
base compatibility mode, k6 will instead rely only on the goja runtime and what is built into k6. This can be configured through the new
--compatibility-mode CLI flag and the
K6_COMPATIBILITY_MODE environment variable.
See the documentation for details.
JSON export of the end-of-test summary report
This returns (from the very early days of k6) the ability to output the data from the end of test summary in a machine-readable JSON file. This report can be enabled by the
--summary-export <file_path> CLI flag or the
K6_SUMMARY_EXPORT environment variable. The resulting JSON file will include data for all test metrics, checks and thresholds.
New CSV output
There is an entirely new
csv output that can be enabled by using the
--out csv CLI flag. There are two things that can be configured: the output file with
K6_CSV_FILENAME (by default it’s
file.csv), and the interval of pushing metrics to disk, which is configured with
K6_CSV_SAVE_INTERVAL (1 second by default). Both of those can be configured by the CLI as well:
--out csv=somefile.csv will output to
--out csv=file_name=somefile.csv,save_interval=2s will output again to
somefile.csv, but will flush the data every 2 seconds instead of every second.
The first line of the output is the names of columns and looks like:
metric_name,timestamp,metric_value,check,error,error_code,group,method,name,proto,status,subproto,tls_version,url,extra_tags http_reqs,1573131887,1.000000,,,,,GET,http://httpbin.org/,HTTP/1.1,200,,,http://httpbin.org/, http_req_duration,1573131887,116.774321,,,,,GET,http://httpbin.org/,HTTP/1.1,200,,,http://httpbin.org/, http_req_blocked,1573131887,148.691247,,,,,GET,http://httpbin.org/,HTTP/1.1,200,,,http://httpbin.org/, http_req_connecting,1573131887,112.593448,,,,,GET,http://httpbin.org/,HTTP/1.1,200,,,http://httpbin.org/,
http.batch()calls are now more efficient, and
batchPerHostwas reduced from
6, to more closely match browser behavior. The return values of
http.batch()calls are now more consistent, returning either array or object depending on the passed argument.
- JSON output optimizations: samples are now buffered and written at regular configurable intervals (like all other outputs), and a faster data encoding method is used which also decreases memory usage.
- The InfluxDB output now uses less memory and tries to send smaller and consistent chunks of data to InfluxDB, in order to not drop packets and be more efficient. Both the push interval and number of concurrent write calls to InfluxDB are configurable.
consoleis now available in the init context! With a known bug tracked in #1131.
- HTTP response bodies now support decompression with multiple layered algorithms.
Trendmetrics in the end-of-test summary, enabled with
Along with several other enhancements, bug fixes, and build improvements! You can see the detailed list in the full release notes, and particularly note the few minor breaking changes.
Happy testing and Happy Holidays from the k6 team!