Affects Version/s: 0.12
Fix Version/s: None
Component/s: Python Tools
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:
Furthermore, this second issue compounds the first. For example:
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?