summaryrefslogtreecommitdiffstats
path: root/src/data_conversion.rs
AgeCommit message (Collapse)Author
2021-05-11bug: forgot to create memory usage string when collapsed (#473)Clement Tsang
Adds a line to actually build the string of the summed memory usage. I forgot to make the string after summing the values.
2021-04-09change: Add decimal to disk values larger than 1GB (#451)Clement Tsang
A bit of a followup to #449, this adds decimal places for values over 1GB in regards to disk usage. This affects the disk widget (for the read/write per second) and process widgets (total read, total write, read/write per second).
2021-04-09change: Add decimal to actual memory usage in proc (#449)Clement Tsang
This change adds a decimal + single digit to memory usage values over the 1 GiB threshold. Otherwise, there is no visible change. (Note to self: implement the per-column width system soon, this change causes some values to potentially look a bit weird in mem-non-percent mode as it is if the value is really large, like 530.2GiB pushing right up against the column width, but it's currently tied to mem-percent mode. Ugh.) Also revert a change made by accident where I switched to a decimal prefix system (GB) for memory values. This has been reverted back to a binary prefix (GiB).
2021-04-07refactor: Unify disk conversion to string step (#446)Clement Tsang
Refactor to unify the process disk usage -> string into one function.
2021-04-05feature: Collapsing in tree mode sums usage to parent (#445)Clement Tsang
For the process widget, we now sum the resource usage of the child processes on the parent entry when collapsing in tree mode. Note that if you search to filter, and collapse, it will not sum the pruned values (values that cannot be seen). This is partly because I'm a bit lazy, and partly because I think this behaviour makes sense. For example, let's say I search for a process with 4 child processes "AA, AB, BA, BB", with CPU usage 0.1, 0.2, 0.3, 0.4 respectively. Assume the parent process has 0 usage. - Without filter, it sums to 1.0 - With a filter on A, it would sum to just 0.3 - With a filter on AA, it would sum to 0.1 I think this is fine because I'm treating this as summing any child that is still *visible* somehow. Summing unseen values would probably be weird as it would look like it's not adding up. Further note that if you had, say, a child "CC" with a usage of, say, 2.0, and its parent of "AB", and you searched for CC in our above example, you would get a sum of 2.2. This is because AB is still visible by the fact that CC was the searched process, and AB must still exist (albeit faded out) in the tree hierarchy, and as such will still be displayed.
2021-04-04refactor: Switch from fnv to fxhash (#444)Clement Tsang
Switches to fxhash from fnv, which should be a bit faster.
2021-04-04change: Make proc widget unit consistent with disk (#443)Clement Tsang
In particular, use non-binary prefixes for disk and memory usage in a process. Ideally everything is configurable by the user, but this is fine for now IMO until I can get around to doing in-app config.
2021-04-04feature: Rework network y-axis, linear interpolation for off-screen data (#437)Clement Tsang
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already. Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network). This can be optimized, and will hopefully be prior to release in a separate change.
2021-02-28feature: User info in proc widget for Unix-based systems (#425)Clement Tsang
Adds users into the process widget (for Unix-based systems). This shows only in non-grouped modes, similar to state. Search is also supported. In addition, a quick fix to prevent users from being in grouped mode when they tried to enter tree mode while grouped.
2021-02-24bug: Fix bugs with disk widget and disk encryption (#423)Clement Tsang
Two issues were highlighted as a result of using either Void Linux with disk encryption, or just disk encryption on Linux in general: Two fixes: 1. Fixes a failed `usage()` call in the `get_disk_usage` function from failing the entire result. Now it only returns an entry with N/A results. This occurred in some distros and disk encryption setups, for example, the one for Void Linux here: https://docs.voidlinux.org/installation/guides/fde.html. 2. Fixes a potential mapping issue with disk encryption on Linux in general. Since the disk might map to `/dev/mapper/whatever`, but the I/O harvester was using another name, the mappings would not match. As such, we now also check if a symlink exists; if it does, then we take it and work out the correct path. This also fixes the disk name being wrong.
2021-01-20feature: Show Celcius/Fahrenheit with degree symbol (#391)Erlend Hamberg
2021-01-01feature: Add network interface filtering (#381)Clement Tsang
Adds a new option in the config file to filter out network interfaces. Also add the option to filter by whole words. Interface follows that of the existing ones: ```toml [net_filter] is_list_ignored = false list = ["virbr0.*"] regex = true case_sensitive = false whole_word = false ```
2020-12-22feature: Hide SWAP graph and legend in normal mode if SWAP is 0 (#372)Clement Tsang
Firstly, note this currently won't affect basic mode. There is code changes due to it, but instead, we'll just display `0.0B/0.0B` instead. I'm personally not really sure if we want to get rid of it in basic mode, since it'll leave an ugly gap in that mode. Anyways, this change is mainly for the normal mode. All this does is hide the legend entry and chart if the total SWAP drops to 0 KB. It also has a small change to do a unit check on the memory used, as well as slightly adjusting the calculation we use.
2020-12-16deps: Update various dependencies (#358)Clement Tsang
2020-12-12refactor: More minor optimization changes (#353)Clement Tsang
- Move data rather than cloning during data transferring step - Try using beef?
2020-12-11refactor: Another small optimization pass (#350)Clement Tsang
Making some small changes that would hopefully improve performance a bit. - Remove redundant string generations for CPU data conversion - Switch to fnv for PID hashmap and hashsets - Use buffered reading to avoid having to store too many lines as strings
2020-12-10bug: Fix some performance regressions (#344)Clement Tsang
Fixes some performance regressions and forgotten cleanup. Changes to attempt to improve performance to match 0.4.x: - Remove `trace!` and `--debug` for now. These were a significant hog. Removing this dropped initial memory usage by about half. - Add additional cleaning step for `pid_mapping` during process harvesting. This should hopefully improve memory usage as time goes on. - Slightly change how we do sorting to hopefully be a bit more optimal? This was just an easy change to make that I spotted. - Fix broken cleaning child thread task.
2020-11-22other: Switch to once_cell (#324)Clement Tsang
Switch from lazy_static to once_cell.
2020-11-18feature: Add collapsible tree entries (#304)Clement Tsang
Adds collapsible trees to the tree mode for processes. These can be toggled via the + or - keys and the mouse by clicking on a selected entry.
2020-11-02refactor: Better responsiveness when resizing cpu basic widget (#292)Clement Tsang
Gives better and less jank responsiveness when resizing the window in narrow sizes for the cpu basic widget.
2020-09-09refactor: rewrite column algorithm (#227)Clement Tsang
Update how we position and generate column widths to look less terrible. This also adds truncation w/ ellipsis to the columns, and for processes, the state will automatically shrink to a short form (just a character) if there isn't enough space.
2020-09-06feature: Adds tree view (#223)Clement Tsang
Adds a tree process view to bottom. Currently uses a pretty jank method of column width setting, should get fixed in #225.
2020-09-02feature: Add ability to filter out disks and temp (#220)Clement Tsang
You can now filter out disks and temp sensors by name via config.
2020-09-02other: aarch64 support (#217)Clement Tsang
Adds theoretical aarch64 support.
2020-08-31bug: Use correct labels for sensors in Linux (#215)Clement Tsang
Update temperature sensors in Linux to use labels + names rather than just names.
2020-08-28feature: Adaptive network widget (#206)Clement Tsang
Allows the network widget graph to grow/shrink with current data, rather than using a static size.
2020-08-25bug: fix grouping being broken after refactor (#201)0.4.6Clement Tsang
Fixes grouping not working properly after some refactoring done in 0.4.6.
2020-08-21feature: Support memb (mem bytes) searching in processesClement Tsang
Supports searching by the new mem value.
2020-08-21refactor: Remove ps callsClement Tsang
Removes and refactor ps calls that... should have not been there in the first place.
2020-08-17feature: Add appox. total mem as an option for processes and basic memClement Tsang
Adds a way to display the memory value as a column in the processes widget and the basic memory widget, rather than just the percentage.
2020-08-15feature: Allow sorting by any columnClement Tsang
This feature allows any column to be sortable. This also adds: - Inverting sort for current column with `I` - Invoking a sort widget with `s` or `F6`. Close with same key or esc. And: - A bugfix in regards the basic menu and battery widget - A lot of refactoring
2020-08-07feature: add full command to process widgetClement Tsang
This PR adds the ability to toggle between the process name and process path. Currently, this uses `P` as the modifier key. Currently, the longer command names are dealt with by forcefully changing the width of the columns, but this can be handled in a more graceful manner IMO.
2020-05-19feature: add back states to unmerged processesClement Tsang
2020-05-16change: remove slash, change scroll behaviour on cpuClement Tsang
- Removal of the old slash-space-to-hide behaviour of CPU widget - Scrolling onto a specific entry will only show that entry - Showing average is now default
2020-05-11refactor: use a nicer match statement in one spotClementTsang
2020-05-11force SWAP and RAM labels to show even if at 0ClementTsang
2020-05-10refactor: re-enable tui-rs linear interpolationClementTsang
2020-05-02change: add byte units to searchClementTsang
2020-05-02change: more advanced searching and filteringClementTsang
2020-04-28refactor: revert linear interpolation until tui fix comesClement Tsang
2020-04-26feature: add battery health percentageClement Tsang
2020-04-20Move to tui-rs' built in linear interpolationClementTsang
2020-04-18Update network legend againClementTsang
2020-04-16feature: Add battery widget (#120)Clement Tsang
2020-04-11feature: Show process state (#114)Clement Tsang
This is not 100% finished and will be refined in the future, as I plan to do a bit of an overhaul on how the process widget is going to look and functionality. In particular, tabbed is currently kinda just slapped together (I just combine all the states together as one big string). However, it is enough to work and show state normally...
2020-04-10feature: add io and io/s for processes (#113)Clement Tsang
2020-04-06refactor/bug: Array bound checking, fix CPU jumpClement Tsang
2020-04-01Add modularity to widget placement and inclusion (#95)Clement Tsang
2020-03-13Cleanup before modularity (#84)Clement Tsang
* Uptick some crates, update README dependencies * Cleanup before modularity feature. * Fix missing reset zoom on reset * Fixed reset... not resetting search or data displayed * Cleaned up options a tiny bit to make more sense. * Cleaned up some TODOs and the like. * specify only build master branch.
2020-03-11Fix cpu legend colouring (#83)Clement Tsang
* Initial fix, but pending a rewrite. * Initial fix, but pending a rewrite. * Merged two separate iterations into one for cpu legend. * Refactor average cpu, fix bug with legend and cursor.