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!
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.
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.
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.
consoleis now available in the init context! With a known bug tracked in #1131.
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!