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

Unexpected output when using --quiet #782

Closed
na-- opened this issue Sep 27, 2018 · 7 comments · Fixed by #2411
Closed

Unexpected output when using --quiet #782

na-- opened this issue Sep 27, 2018 · 7 comments · Fixed by #2411

Comments

@na--
Copy link
Member

na-- commented Sep 27, 2018

If I execute k6 --quiet run script.js > output-stdout.log 2> output-stderr.log where script.js contains:

export default function () {
	console.log(`VU ${__VU} executing iteration ${__ITER}`);
}

I'd expect to see something like this in one of the files:

VU 1 executing iteration 0

indeed, output-stdderr.log contains the logged message:

time="2018-09-27T15:47:52+03:00" level=info msg="VU 1 executing iteration 0"

the log format change is somewhat understandable (since we redirect the err stream to a non-TTY output), and even though logging user console.log() messages to stderr is a bit strange, at least it's consistent.

My troubles are with output-stdout.log, because it contains this:


          /\      |‾‾|  /‾‾/  /‾/   
     /\  /  \     |  |_/  /  / /   
    /  \/    \    |      |  /  ‾‾\  
   /          \   |  |‾\  \ | (_) | 
  / __________ \  |__|  \__\ \___/ .io

    init [----------------------------------------------------------] runner
    init [----------------------------------------------------------] options
    init [----------------------------------------------------------] executor
    init [----------------------------------------------------------]   engine
    init [----------------------------------------------------------]   collector
    init [----------------------------------------------------------]   server
  execution: local
     output: -
     script: so.js

    duration: -, iterations: 1
         vus: 1, max: 1

    init [----------------------------------------------------------] starting

Which is not very quiet at all...

@openmohan
Copy link
Contributor

Just for my understanding:
so when k6 --quiet run script.js > output-stdout.log 2> output-stderr.log is ran, the output-stdout.log should be populated with console.log message ie : time="2018-09-27T15:47:52+03:00" level=info msg="VU 1 executing iteration 0"

Can you please confirm @na--

@na--
Copy link
Member Author

na-- commented Oct 22, 2018

@openmohan, not exactly. In my opinion, when --quiet mode is enabled, those things shouldn't be outputted at all, regardless if it's on stderr or stdout.

@apmattil
Copy link

I would expect the report at stdout even the quiet is on.
-q, --quiet disable progress updates
I assumed the progress bar is not shown.. not the whole report.

@mstoykov
Copy link
Collaborator

@apmattil Yes.
What we actually want is for the whole banner(k6 logo thing), the number of VUs, duration and such information that is printed about the test to be missing + the progressbar.
But we would like to see all the output of console.log from inside the script, all warning/errors that could happen (like the one about the not enough VUs for all iterations) and the end of run summary. The console.log has an issue and pr to be able to be redirected, the summary have a way to be removed. Maybe in the future we should have a way for the errors and warning to be hidden as well but this probably should be done in another issue.

@na-- na-- added this to the v0.26.0 milestone Aug 27, 2019
@na-- na-- modified the milestones: v0.26.0, v0.27.0 Oct 10, 2019
@na-- na-- modified the milestones: v0.27.0, v0.28.0 May 21, 2020
@na-- na-- modified the milestones: v0.28.0, v0.29.0 Sep 8, 2020
@mstoykov
Copy link
Collaborator

mstoykov commented Nov 2, 2020

This is the current status of this. But I am starting to question if what we want is for everything to be gone ... after all -q does say only "progress updates" and arguably that is the most useful part for most people - not to have a lot of spamming progress updates when running it in CI.
The summary can be dropped on it's own and we can probably add options for the others as well.
On the other hand there should probably be one option which does ... all of that and --quiet seems like the best choice.
image

@tlinhart
Copy link

tlinhart commented Nov 3, 2020

It would be handy to get rid of all the output. Suppose I want to pipe the JSON output to jq to get the metrics and then pipe it straight to curl for indexing to Elasticsearch. At the moment, I have to store the output in a file, run jq processing at the end of the load test and then index it as a third step.

@na--
Copy link
Member Author

na-- commented Nov 4, 2020

This depends on #1376

@na-- na-- modified the milestones: v0.29.0, v0.31.0 Nov 4, 2020
@na-- na-- modified the milestones: v0.31.0, v0.32.0 Feb 24, 2021
@na-- na-- removed this from the v0.32.0 milestone Apr 14, 2021
@na-- na-- added this to the v0.38.0 milestone Mar 6, 2022
@na-- na-- linked a pull request Mar 6, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants