-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
bucket: "inspect --sort-by" is not numeric-aware #2414
Comments
The human-readable durations will make sort by post-processing tedious. If we really want to resort to post-process, then an option to output durations as a number (e.g. seconds) would be needed. Or, a compromise proposal: keep human-readable durations, but used a fixed format suitable for the existing alphabetic sort. And instead of negative durations, output a zero duration to indicate that no event is pending. For example:
( Using a fixed format will help readability anyway... |
I think it makes sense that we would sort these values by their numerical value, not by the order of alphanumeric characters. It seems like the code at the end of |
I see, the code is already doing a numeric sort for FROM / UNTIL since the dates are in DD-MM-YYYY format. (Alphanumeric sort would be sufficient if the format was "YYYY-MM-DD".) To fully support
It may be better to refactor the code to sort the underlying values, rather than the string representations. |
Thanos, Prometheus and Golang version used: v0.11.0
What happened:
bucket inspect --sort-by UNTIL-DOWN
does not produce expected orderingWhat you expected to happen: sort numerically by time duration
If it's too complex to support alpha vs. numeric, sorting direction, etc. perhaps it would be better to remove the
--sort-by
feature and leave it to post-processing...How to reproduce it (as minimally and precisely as possible):
The text was updated successfully, but these errors were encountered: