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

Support for group duration threshold #2

Closed
burtoni opened this issue May 12, 2020 · 4 comments
Closed

Support for group duration threshold #2

burtoni opened this issue May 12, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@burtoni
Copy link

burtoni commented May 12, 2020

Hi, I can't get group duration thresholds to appear as a test case in the JUnit output, despite appearing as a failed check in the k6 output.

I've set up a group based on https://k6.io/docs/using-k6/thresholds#copy-paste-threshold-examples:

// Thresholds on global error rate and response time, and group duration for specific group
thresholds: {
    errors: ["rate==0.0"],    // 0% errors
    'http_req_duration': ['p(90)<100'],
    'group_duration{group:::get_user}': ['p(90) < 50'], 
  }

group('get_user', function() {
  // Do stuff
});

The group fails the response time validation in the k6 output:

    group_duration.......................: avg=157.66ms min=34.99ms med=184.26ms max=395.97ms p(90)=278.91ms p(95)=305.41ms
    ✗ { group:::get_user }...............: avg=250.91ms min=189ms   med=242.64ms max=395.97ms p(90)=305.54ms p(95)=332.19ms

However, only the errors and http_req_duration thresholds have test cases created; the group duration is omitted.

Is group syntax supported?

@Mattihew Mattihew added the bug Something isn't working label May 12, 2020
@Mattihew
Copy link
Owner

appears to be an issue with the regex i'm using to detect the failed lines. the colon(:) character is messing it up. should be a simple fix, will try and get this done today after i've finished work.

@burtoni
Copy link
Author

burtoni commented May 12, 2020

I had a dig as well and thought that was what it might be. I’ll have a look and see whether there are any other cases that trigger it eg tags.

@Mattihew
Copy link
Owner

should be fixed now in version 1.0.3
@burtoni let me know if this works for you now aswell

@burtoni
Copy link
Author

burtoni commented May 12, 2020

Confirmed this works for both tags (name=get_user) and groups (group:::get_transfer_reasons). Thanks for the quick turnaround!

    <testcase name="{ group:::get_transfer_reasons }">
      <failure message="    ✗ { group:::get_transfer_reasons }...: avg=101.46ms min=53.83ms med=70.8ms   max=348ms    p(90)=204.87ms p(95)=287.26ms">    ✗ { group:::get_transfer_reasons }...: avg=101.46ms min=53.83ms med=70.8ms   max=348ms    p(90)=204.87ms p(95)=287.26ms</failure>
      <system-out>    ✗ { group:::get_transfer_reasons }...: avg=101.46ms min=53.83ms med=70.8ms   max=348ms    p(90)=204.87ms p(95)=287.26ms</system-out>
    </testcase>
...
    <testcase name="{ name:get_user_request }">
      <failure message="    ✗ { name:get_user_request }..........: avg=69.85ms  min=48.1ms  med=64.27ms  max=130.89ms p(90)=98.27ms  p(95)=104.89ms">    ✗ { name:get_user_request }..........: avg=69.85ms  min=48.1ms  med=64.27ms  max=130.89ms p(90)=98.27ms  p(95)=104.89ms</failure>
      <system-out>    ✗ { name:get_user_request }..........: avg=69.85ms  min=48.1ms  med=64.27ms  max=130.89ms p(90)=98.27ms  p(95)=104.89ms</system-out>
    </testcase>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants