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

Calculations Based on Metrics #817

Closed
joegfutrli opened this issue Oct 17, 2018 · 1 comment · Fixed by #1768
Closed

Calculations Based on Metrics #817

joegfutrli opened this issue Oct 17, 2018 · 1 comment · Fixed by #1768
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature

Comments

@joegfutrli
Copy link

joegfutrli commented Oct 17, 2018

I am using k6 to test a system the renders data based on requests. The full cycle involves making the request with some parameters and data, then asking for the rendered output until something is returned. Obviously not everything gets rendered by the time the test is complete.

I have two Counter metrics in my current test suite that do the following:

  • One that ticks up every time a request is successfully made
  • One that ticks up every time a request is rendered and returned

I would like to see the proportion of requests that have been successfully rendered, i.e. the result of the value of renderCounter divided by the value of requestCounter.

Is there a way to extract values from these counters? Otherwise is there any kind of summary block where you can specify calculations that need to be made at the end of a run (based on the results of the run)?

@na--
Copy link
Member

na-- commented Oct 18, 2018

Generic calculations based on the end-of-test summary metrics aren't currently possible, but we eventually plan to support them, these are the issues about it: #647 and #351. Before that, you'd have to pipe the metrics to an external output like JSON or InfluxDB and do the calculations that way.

In your particular case though, I think that instead of (or in addition to) the 2 counters, you may be able to do what you want with a custom Rate metric?

@na-- na-- added enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature labels Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants