Non-intuitive qpid-stat -L / --limit option application
-------------------------------------------------------
Key: QPID-3738
URL: https://issues.apache.org/jira/browse/QPID-3738
Project: Qpid
Issue Type: Improvement
Components: python tools
Affects Versions: 0.12
Reporter: Paul Colby
Priority: Trivial
There are a couple of minor things about the way {{qmf-stat}}'s {{-L}} option
is applied that I think are worth revising.
Firstly, the option defaults to 50. IMO, a default of 0 (or no limit) would be
more appropriate. I can think only two reasons the limit may have been set to
something non-zero.
# To return early when receiving a long list of items from the Qpid library?
The code does not do this. Even with a limit of 50, all possible items are
fetched first.
# To avoid having to sort the entire list? As it is now, the sort function
sorts all items returned, and only then considers this limit.
So I'm guessing the limit is only there to help the user manage their screen
output (a valid purpose), but I think the usual convention with *nix utils is
to return everything, unless asked to do otherwise (ie default to no-limit).
Secondly, the {{-L}} option seems to *only* apply to sorted results. For
example:
{code}
qpid-stat -q -L 10 // Shows as many queues as possible (the -L is
silently ignored).
qpid-stat -qIS queue -L 10 // Shows up to 10 queues (assuming QPID-3737 has
been applied).
{code}
Furthermore, this second issue compounds the first. For example:
{code}
qpid-stat -q // Shows as many queues as possible.
qpid-stat -qIS queue // Shows up to 50 queues.
{code}
I'm not sure what the best solution to this second issue should be... perhaps
either:
# add code to apply the limit when not sorting too; or
# drop the {{-L}} flag altogether.
Personally, I'm in favour of simply dropping that option since its more natural
for me to use tools like {{head}} and {{less}}, but if the default limit was
set to zero (ie no-limit), then it wouldn't matter to me either way :)
Ideas? thoughts? preferences?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]