-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Show metric counts for Trend metrics #1087
Comments
I'm currently exploring this issue, and would like to confirm the requirements. As discussed briefly over Slack with @na--, the trend count should be displayed immediately after the trend name and colon, as the first column, without a column name, like so:
And this should only be displayed for user-created metrics, not any of the built-in trend metrics like If yes, that makes sense, but would skew the column alignment of this row compared to the other trend metrics. Should we care about this and pad the other rows with blank space to match? But more important than this alignment issue is that I currently don't see an easy way of distinguishing user-created metrics from built-in ones when rendering the results. Is there an existing way of doing this (besides checking metric names), or should we add another field to If no (i.e. the count should be shown for built-in metrics as well), then that avoids the above two issues, but it doesn't make much sense to show, since the count will likely be the same for all and Also, one minor question: should we display the column name in addition to the value? E.g. Let me know what you think. |
Hmm a very good question... My gut feeling is that we should display this for all So, unfortunately, it seems like we'd either have to:
Not great, but not super annoying either... Notice that the subset of So, in summary, I think we should always display the count, even if there's some repetition, just in a maximally unobtrusive way. What's more, I'm not sure we should always emit all @mstoykov, @cuonglm - thoughts?
I'd consider fixing the alignment a separate issue, since we already have issues there: #1024 |
Ah, I just realized another point in favor of the second approach 😄 If we don't like how this looks, we don't actually need to always display the Instead, we just need to have it available as an option that can be configured via the |
Thanks @na--, I like the approach of adding it as a last column, since it doesn't shift the existing column positions, so it's mostly backwards compatible if people were parsing this output (like GitLab mentioned, I think). I'll give that a try and create a PR. Giving the option to enable/disable/reorder columns would also be great eventually. Do we have an issue about that? |
We already have that option 😄 Read through the docs and the code to see how it's used: https://github.com/loadimpact/k6/blob/d385166a821a8cd98a4ab2c158b3982d87ee61a5/lib/options.go#L317-L321 So we should be able to expose the |
Oh, I thought that option was for showing additional custom stats (e.g. OK, it makes sense to show |
To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
This adds an optional count column for Trend metrics in the CLI summary output, while refactoring parts of ui/summary.go for code style (avoiding globals, explicit validation, etc.) and negligible performance improvements (using a map for column lookups). To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
This adds an optional count column for Trend metrics in the CLI summary output, while refactoring parts of ui/summary.go for code style (avoiding globals, explicit validation, etc.) and negligible performance improvements (using a map for column lookups). To enable it run e.g. `k6 run --summary-trend-stats 'avg,p(99.99),count' test.js`. Closes #1087
As this user has pointed out, it doesn't make sense that we don't show the count of
Trend
metrics, especially since we actually have it available.The text was updated successfully, but these errors were encountered: