You can output granular data points in CSV format. To do so, use k6 run with the --out flag. Pass the path for your CSV file as the flag argument:
CLI
You can also get the results gzipped, like this:
CLI
To inspect the output in real time, you can use a command like tail -f on the file you save:
CSV format
The CSV result file will look something like this:
Output
Each entry in the report represents a metric, metric_name, along with its value, metric_value, at time, timestamp. If an error happens, then the error along with the error_code fields will be populated.
CSV options
k6 provides a few options to help you configure your CSV output:
option | Configures | Possible values | Default | Env. variable |
---|---|---|---|---|
saveInterval | The time intervals at which k6 writes to the CSV | Either a string with time units("1m45s"), or a number of milliseconds | "1s" | K6_CSV_SAVE_INTERVAL |
timeFormat | The timestamp format | unix, rfc3339 | unix | K6_CSV_TIME_FORMAT |
fileName | The file name and path where output is saved | N/A | file.csv | K6_CSV_FILENAME |