https://github.com/janritter/k6-duration-extractor
Tool to extract the duration information per request from the K6 csv output
https://github.com/janritter/k6-duration-extractor
Last synced: about 2 months ago
JSON representation
Tool to extract the duration information per request from the K6 csv output
- Host: GitHub
- URL: https://github.com/janritter/k6-duration-extractor
- Owner: janritter
- License: mit
- Created: 2021-08-10T20:01:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-17T02:49:58.000Z (3 months ago)
- Last Synced: 2025-03-24T12:35:47.314Z (2 months ago)
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# K6 duration extractor
[](https://circleci.com/gh/janritter/k6-duration-extractor/tree/main)
[](https://codeclimate.com/github/janritter/k6-duration-extractor/maintainability)
[](https://codeclimate.com/github/janritter/k6-duration-extractor/test_coverage)> Tool to extract the duration information per request from the K6 csv output
## Prerequisites
- Golang >= 1.16.6## Installation
### Clone git repo
```bash
git clone [email protected]:janritter/k6-duration-extractor.git
```### Open project directory
```bash
cd k6-duration-extractor
```### Install via go
```bash
go install
```## Installation via Homebrew (For Mac / Linux)
### Get the formula
```bash
brew tap janritter/k6-duration-extractor https://github.com/janritter/k6-duration-extractor
```### Install formula
```bash
brew install k6-duration-extractor
```## Usage
### Execute your K6 test with CSV output
```bash
k6 run --out csv=result.csv script.js
```### Run the k6-duration-extractor for the result.csv K6 output file
```bash
k6-duration-extractor result.csv
```The k6-duration-extractor will save each request duration in a CSV file called `-extracted.csv`
In our case this is `result-extracted.csv`
## Result example
```csv
timestamp,duration,check,error_message,error_code,group,method,name,proto,scenario,status,subproto,tls_version,url,extra_tags
1595325560,221.899000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,
1595325560,221.899000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,
1595325560,221.899000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,
1595325560,221.899000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,
1595325560,221.899000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,```
## License and Author
Author: Jan Ritter
License: MIT