Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gzip in csv output format #1566

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

thejasbabu
Copy link
Contributor

@thejasbabu thejasbabu commented Jul 21, 2020

Fixes: #1550

Refactor:

  • Add closeFn for CSV collector
  • Made writeToFile protected

Tested this by using the following script

test.js

import http from 'k6/http';
import { sleep } from 'k6';

export default function () {
  http.get('http://test.k6.io');
  sleep(1);
}

and running

./k6 run --out csv=test.csv.gz test.js

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2020

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2020

Codecov Report

Merging #1566 into master will increase coverage by 0.01%.
The diff coverage is 93.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1566      +/-   ##
==========================================
+ Coverage   77.11%   77.12%   +0.01%     
==========================================
  Files         162      162              
  Lines       13192    13204      +12     
==========================================
+ Hits        10173    10184      +11     
- Misses       2499     2500       +1     
  Partials      520      520              
Impacted Files Coverage Δ
stats/csv/collector.go 86.17% <93.10%> (+2.39%) ⬆️
lib/testutils/minirunner/minirunner.go 78.57% <0.00%> (-3.58%) ⬇️
lib/executor/vu_handle.go 95.49% <0.00%> (-0.91%) ⬇️
lib/executor/constant_arrival_rate.go 96.75% <0.00%> (-0.55%) ⬇️
stats/cloud/collector.go 79.04% <0.00%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73d5ee7...2e3de4e. Read the comment docs.

@na-- na-- added this to the v0.28.0 milestone Jul 21, 2020
@thejasbabu
Copy link
Contributor Author

Added document for CSV format here

Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for your work @thejasbabu!

This looks good besides the two minor comments. We're aiming for this to be part of v0.28.0 👍

stats/csv/collector.go Outdated Show resolved Hide resolved
stats/csv/collector_test.go Show resolved Hide resolved
Refactor:

- Add closeFn for CSV collector
- Made writeToFile protected

Signed-off-by: thejas <[email protected]>
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this and the additional test!

@imiric imiric merged commit b83dbbd into grafana:master Aug 6, 2020
@thejasbabu thejasbabu deleted the gzip-csv branch August 6, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to csv output to gzip the file
6 participants