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

[Console output] http_req_failed : "succMark" & "failMark" seems inversed? #2306

Open
placaze opened this issue Dec 19, 2021 · 9 comments · May be fixed by #3656
Open

[Console output] http_req_failed : "succMark" & "failMark" seems inversed? #2306

placaze opened this issue Dec 19, 2021 · 9 comments · May be fixed by #3656
Assignees
Labels
bug evaluation needed proposal needs to be validated or tested before fully implementing it in k6 ux

Comments

@placaze
Copy link

placaze commented Dec 19, 2021

Brief summary

     data_received..................: 7.2 MB 240 kB/s
     data_sent......................: 498 kB 17 kB/s
[...]
     http_req_failed................: 56.68% ✓ 403      ✗ 308
[...]
     http_reqs......................: 711    23.61168/s

I think ✓ and ✗ are inversed here. There should be more failed than succeed.

k6 version

0.35.0

OS

Windows 10

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Do a simple run of k6. Nothing fancy.

Expected behaviour

http_req_failed................: 56.68% ✓ 308      ✗ 403

Actual behaviour

http_req_failed................: 56.68% ✓ 403      ✗ 308
@placaze placaze added the bug label Dec 19, 2021
@na-- na-- added ux evaluation needed proposal needs to be validated or tested before fully implementing it in k6 labels Dec 20, 2021
@na--
Copy link
Member

na-- commented Dec 20, 2021

Thanks for reporting this! Technically, since the http_req_failed metric is tracking the failures, it's technically correct. But yeah, that's super confusing 😞

So, I'm not sure if we should just reverse the marks, but maybe we should hide them or turn them into text labels? 🤔

http_req_failed................: 56.68% failed: 403      successful: 308

Also, I am not sure if this should be a hack, a check just for the http_req_failed metric in here:

k6/js/summary.js

Lines 233 to 238 in 804203b

case 'rate':
return [
humanizeValue(metric.values.rate, metric, timeUnit),
succMark + ' ' + metric.values.passes,
failMark + ' ' + metric.values.fails,
]

Or should it be a more universal solution? Maybe Rate metrics should have an additional parameter that allows users to specify that they are inverted? Similarly to how Trend metrics have a parameter that specifies if they are tracking time or not?

For now, as a workaround, you can define your own handleSummary() function to do whatever you want with it, but yeah, we need to fix this in k6.

@NevilleC
Copy link

I got confused by this, too, while discovering k6.

turn them into text labels

To me, text labels would remove any ambiguity 👍

@f0ff886f
Copy link

Hi, so just to clarify, is the %age shown the % of requests that failed? So 0% http_req_failed means 100% requests succeeded (either by the default comparison to 200 status code or overridden by the user)?

So a checkmark in the output defines the amount of failed requests, and the x defines the amount of successful requests?

@na--
Copy link
Member

na-- commented Mar 29, 2022

Yes 😞

@Totalus
Copy link

Totalus commented Apr 25, 2022

+1, that is overly confusing

@na-- na-- added this to the v0.39.0 milestone Apr 26, 2022
@mstoykov mstoykov modified the milestones: v0.39.0, v0.40.0 Jun 15, 2022
@mariaduran-ecr
Copy link

how is it going to affect thresholds? Should the http_req_failed: ['rate '] be reversed as well?

@na--
Copy link
Member

na-- commented Jun 20, 2022

@mariaduran-ecr, it shouldn't. The problem is that the end-of-test summary assumes that all Rate metrics are about measuring "positive" events, i.e. that a rate of 100% is a good thing. That assumption doesn't hold for http_req_failed, where we want the rate of failed requests to be 0%. And it probably also doesn't hold for some custom Rate metrics that users might have defined in their scripts.

And IIRC, http_req_failed is negative precisely because it's easier to reason about it that way when it comes to thresholds. For example, the constraint of "I want under 1% of requests to fail" can be directly expressed as the http_req_failed: ['rate < 0.01'] threshold definition.

@nthornton2010
Copy link

I'm trying out k6 now and this definitely confused the heck out of me.

@codebien codebien removed this from the TBD milestone Sep 27, 2023
@joanlopez joanlopez self-assigned this Jan 11, 2024
@joanlopez joanlopez linked a pull request Mar 20, 2024 that will close this issue
5 tasks
@mstoykov
Copy link
Collaborator

Another proposal that I came up with in #3656 was to actually use words to say how many of the given rate were "truthy"

image

This way it seems like there is no ambiguity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug evaluation needed proposal needs to be validated or tested before fully implementing it in k6 ux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants