-
Notifications
You must be signed in to change notification settings - Fork 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
uniform style of stats/report ascii tables #2084
Conversation
Looks good to me. It's probably a good idea to add an entry to the Changelog, since it's a potentially breaking change when people are parsing the output. For the same reason it might be a good idea to not release this as a "patch" version bump. |
Fair enough, I kind of assumed that one would use the CSV stats writer if any parsing of the statistics would be done :) Will you update the changelog when releasing (looks like that's the way its done according to CONTRIBUTING.md (which by the way looks a bit obsolete), or is there something I should update in the PR? I didn't find any instructions under Developing Locust. |
LGTM. Have you checked that it works with resizing the terminal window? I can do the changelog & make sure next version is a minor release rather than patch. |
Nice! I wont make a new releaese just yet, because there is another open PR with potentially breaking changes, but a prerelease build should be published in a couple minutes. |
Yeah, that's probably true, though I remember seeing someone parsing the output at some point, though it might have been quite a long time ago.
I should probably have clarified that I meant the Changelog Highlights in the docs. Sometimes we've previously included it in the PR under a separate Unreleased / In development headline. Then when a release is made it's easy to just move the entry to the correct release.
👍 |
Huh. I only just now saw the full effects of this change. It increases the line length of the (which I would have seen in your comment if I hadnt been sloppy and reading it on mobile) |
How big of an issue is it really? Sure it's a non-backwards compatible change on request names by something like at max 10 characters (depending on how long the request method is). But the max width is the same as
Also, since method + name used to be in So something like: def print_stats(stats, current=True):
console_logger.info(
(" %-" + str(STATS_TYPE_WIDTH) + "s %-" + str(STATS_NAME_WIDTH - STATS_TYPE_WIDTH) + "s %7s %12s | %7s %7s %7s %7s | %7s %11s")
% ("Type", "Name", "# reqs", "# fails", "Avg", "Min", "Max", "Median", "req/s", "failures/s")
) That still leaves a problem with long request names though... but shouldn't be that much of a difference compared to before. As a last restort, an ugly solution would be to substring the names if they're longer than Looking at |
Backwards compatibility is not super important, as this is just for human consumption. But lines should be as short as possible, and I think it is higher prio than complete consistency between the tables. Terminals come in all shapes and sizes these days. My personal limit is "iterm2 on half a macbook pro screen" (so I can have two next to each other :), which is 119 characters. |
Fair enough. My point with the "default" terminal sizes, was that if the user does not explicitly change it, it would still be too small :) My suggestion would be to reduce the Without the change, minimum width of As it was implemented in this PR, the maximum request name, in the same scenario as above, would always be 80 characters. By reducing the But the total width would be 1 character more than the original implementation, which could be saved by removing the ending I can whip up a new PR, and move the discussion there? |
That sounds great, please do! Long request/type names causing line breaks is ok, but it must be possible to avoid by using reasonably short names. |
print_stats table width fix for #2084
I'm using the console statistics tables to get a quick summary of how a test went, and one thing that has annoyed me a bit, is that
print_stats
,print_percentile_stats
andprint_error_report
ascii tables all have different "style".Especially
print_stats
, wheremethod
andname
is concatenated to one string, resulting in, e.g.GET
andPOST
entries are misaligned.Off the 3 styles, I liked the
print_percentile_stats
most, so fixed the other 2 to have the same style.Comparision with before and after;
print_stats
:print_error_report
:The only change in
print_percentile_stats
is to print an empty string instead ofNone
in theType
column for theAggregated
row:Added unit tests for all 3 methods.