Extension system_stats incorrect sorting of processes by ram usage
Please note that security bugs or issues should be reported to [email protected].
Describe the bug
Extension system_stats incorrect sorting of processes by ram usage - sorting asc/desc doesnt account for units - kb, mb, gb and so on, i.e. 50 kb will be above 30 gb when sorting desc. Using windows 11, pgadmin 4 as standalone program.
To Reproduce
Steps to reproduce the behavior:
- enable system_stats extension;
- Go to dashboard -> system -> memory;
- Try sorting list of processes by clicking on column name "Memory bytes";
Expected behavior
List to be sorted by ram usage, accounting for both units and numerical values;
Error message
No error, but sorting is now "dumb" and raw and wrong, doesnt account for units, only applies sorting to final visible string of text, which is wrong in this type of sorting.
Screenshots
As you can see, this is sorted in descending order. This needs custom sorting function, either comparing raw byte values, or parsing final text, setting fixed order for units, and only then looking at numerical values.
Desktop (please complete the following information):
- OS: windows 11
- pgAdmin version: 9.9 , but tried older versions too, still the same
- Mode: desktop
- Browser (if running in server mode): -
- Package type: native windows installer