* add zfs io counters for linux and freebsd
* ci
* freebsd clippy
* code review: remove dead code for zfs feature gate of freebsd iocounters and squash if statement in zfs_io_counters
* bug: fix core dump if the terminal is closed
The cause was:
- bottom thinks it's panicking if the terminal is closed.
- The panic hook tried to print out to the terminal - but the terminal
was closed! It would unwrap and thus panic even harder.
- To solve this, we just make the panic hook calls not unwrap, since
honestly if they fail it's whatever as far as I understand it.
* update changelog
* update documentation and support either numerical times or human times for time_delta and default_time_value
* update docs
* give more human times on error
The clap matches/config struct was taken in as a reference when building
the App structure. However, we do not need to keep these around after
this, so we can instead take ownership of the match/config and drop it
after to save a bit of memory.
clap v4 apparently changed it so arguments are not sorted by default
like before - this manually sorts the arguments beforehand to achieve
the same effect.
* other: use f32 for process percentage values
This cuts down memory by a tiny bit, and we don't need a full f64 for
percentage values.
* fix for macos and windows
* feature: also check coretemp on Linux when gathering temps
* update changelog
* add comment
* add logic to check thermal zone if there are no hwmon entries
* cleanup
* handle duplicates between hwmon and thermal zone
* Revert "handle duplicates between hwmon and thermal zone"
This reverts commit 402606cc62f27ba196ef2ade6a669ae84aedf0e0.
* cleanup
* back to running thermal zone if no hwmon
* prevent failure cases
* temp logging
* name refactoring
* port dupe name logic to hwmon
* Cleanup, add fallback to sensor name
* more tests
* Fix log
* update changelog
* cleanup and more tests
* ci: add a build check for aarch64-linux-android
* appease clippy
* use 1.67.0 for Android due to NDK issue
* remove sparse since it is default now for 1.70 and causes issues with older versions anyway
* refactor: redo how we do some processes between different OSes
* cleanup
* more cleanup
* windows
* freebsd
* clean up linux more, fix broken FreeBSD import
* some more cleanup to remove some big imports
* other: enforce unused_imports lint again
I think there shouldn't be any issues with enforcing this now...
* set up cfg block so the logging feature doesn't break clippy
* some cleanup + comments
* bug: when getting Linux temps, don't bail ASAP if they fail
This meant that if hwmon failed, it would never try and get temperatures
from thermal or GPU. The same is true for thermal failing leading to GPU
never running.
* update docs
This just simplifies the logic around ctrl-c and termination logic and
event loop logic to something simpler and without the need for timeouts
and/or atomics.
Instead, we just make termination an event sent by ctrl-c and use the
same receiver for event handling to react to it and break the loop.
This just makes it so that even if the logger is enabled, if it fails to
initialize (e.g. read-only directory), bottom will still continue to
start up, and just print a warning that the logger encountered an issue.
* feature: show running time of processes
* fix clippy
* add time searching
* update changelog
* use safer duration for linux in case of 0
* some cleanup
* quick hack to deal with some Windows processes returning unix epoch time as start time
---------
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
* feature: add customizable process columns
* Add some tests and actual logic
* more tests
* update changelog
* update config field
* even more tests
* update documentation
* more testing
* deps: remove const_format dependency
I was importing it for just one use case, but I could just define the
const string manually and not pull it in at all.
* update husky entry
Seems like I broke this when migrating from tui-rs to ratatui. This just
uses explicit enum variants to set my side borders and a test to try and
make sure this doesn't happen again.
* other: add first draw immediately after initialization
Previously, I would only do the first draw after an event triggered, so
this just makes it so that I *always* draw once first. Some widgets look
a bit weird with no data, but this is fine I guess if we want to gain a
bit of responsiveness.
* other: potentially shorten first time to get data
* other: move event loop thread init earlier in app initialization
* First implementation of cache memory data collection, mostly copied from RAM and swap implementations
* First implementation of cache memory display, copied from RAM and swap implementations. placed cache as second in the list as it is more similar to the RAM than any other item in the list
* expanded comment to explain method.
* rustfmt
* all cache-related code excluded on windows, in the process refactored src/data_conversion.rs convert_mem_label() to convert a single label instead of all at once
* better factoring-out of cache memory logic to allow individual disabling
* added --enable_cache_memory flag, disabled cache memory collection by default
* renamed CCH to CHE
not sure how i messed that up
* changelog updated
* Added command line flag documentation
* updated config file documentation
* specified that buffer and cache memory display does not work on windows
* resolved merge conflicts
* added documentation to cache memory data collection
* capitalized Windows
* implemented missing canvas styling logic
* fixed misplaced no-windows flag
* reduced colour collisions, as cache colour was the same as the first GPU colour
* made FIFTH_COLOUR constant windows-only
* Revert "made FIFTH_COLOUR constant windows-only"
This reverts commit 72698f1dd7.
* made FIFTH_COLOUR constant non-windows-only
* minor fix for basic mode row count
* Update src/app/data_harvester/memory/sysinfo.rs
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
* Update src/canvas/widgets/mem_basic.rs
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
* updated default_config.toml
* formatting
---------
Co-authored-by: ClementTsang <34804052+ClementTsang@users.noreply.github.com>
* deps: bump once_cell and related dependencies
Now that we've removed heim, I can bump up other dependencies that
relied on newer versions of once_cell.
* Add some dhat code
* dhat gitignore
Migrates existing heim-based disk data collection code off of it to either sysinfo or vendored code based on heim/sysinfo/other sources. This also allows us to remove heim completely from bottom.
---
* refactor: fix some refresh code
* remove async from the freebsd code
* some file/implementation organization
Turns out sysinfo lacks a lot of data I need. I can still use it for the
Windows disk usage implementation, but I'm probably going to manually
implement macos/linux usage and all io usage stats.
* more restructuring
* Some other fixes
* remove futures
* ready for some big changes?
* big changes
* linux io + reads
* use lossy conversion for mount point
* add windows refresh
* so long heim, and thanks for all the fish
* fix filter behaviour, remove string allocation when reading lines
* rename unix -> system for more accurate file struct representation
* fix freebsd
* port generic unix partition code
* add bindings and fix errors
* finish macOS bindings for I/O
* disable conform check, this seems to... make disk I/O work on macOS?????
* fix linux
* add safety comments
* more comments
* update changelog
* changelog
* We're going full 0.9.0 for this
* update lock
* fix some typing
* bleh
* some file management
* hoist out get_disk_usage
* fix some stuff for Windows
* typing and remove dead code allow lint
* unify typing
* fix
* fix 2
* macOS fix
* Add bindings file for windows
* add windows implementation
* fix macos
* deps: update some minor dependency versions
Bump some dependency versions as of April 7, 2023. Note I skipped any
updates tied to futures as that's getting removed along with heim in the
near future (heh).
* fix rename on Windows from K32GetPerformanceInfo -> GetPerformanceInfo
* refactor: unify on using bytes for the memory unit when harvesting
* some ordering stuff that doesn't mean much
* some comments
* more fixes
* refactor: rename
* comments v2
* some more cleanup
* remove uninlined_format_args allow
* refactor: clean up some data collection refresh/init code
* move out battery
* missing setting memory value for proc
* stop segfault on macos
* unit
* oopsie
* refactor: more memory collection cleanup
* more cleanup
* clean up data_harvester, remove heim sensor flag
Separate out most individual components to separate functions. Also
remove Linux's usage of heim's sensors feature, since I wasn't using it
apparently.
* clean up GPU section
* fix cond
* fix feature flags
* more cleanup
* even more cleanup
Use filter logic from network/sysinfo in temperature and network/heim
harvesters. Previously is_list_ignored=false filter configs would
silently accept every sensor and every interface.
* refactor: optimize kept list in tree to just store filtered values in a set
* change: show all direct children of a tree process children if the parent matches
* change: show process in tree if any ancestor or descendent matches
* Upgrade clap to 3.2.2 to allow future fix warnings
* cargo fmt fix
* Replaced deprecated `value_of` and `is_present`, builds with no warnings, clap 3.2.2
* cargo fmt
* updated according to comments. builds fine, cargo test fine
* Match some versions
* Update Cargo.lock
* Fix typo, mb
---------
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
* Revert "other: revert disk usage change for now (#962)"
This reverts commit d3661c2320.
* some cleanup
* update help menu
* update screenshot
* update changelog wording
* Remove redundant newlines
* Use type system to ensure help constants match in size
* Added dynamic battery widget
For bottom to know that there are no batteries on the system,
I added the battery::Manager to the options.rs file because
here is the first moment bottom verifies battery configuration
by reading the config file, which may or may not contain the
battery field, but for a better UX, it doesn't matter what bottom
finds in the config file now, if it doesn't retrieve battery data,
it just ignores the battery widget all together.
If needed, it can be adjusted so that if the config file contains
the battery field, it will still show the widget.
* CFG guarding for BATTERY module
I guarded the options.rs in two places for battery module that can be missing in the feature list.
Co-authored-by: RaresCon <RaresCon>
Co-authored-by: NitrogenDev <44950964+NitrogenDev@users.noreply.github.com>
This adds the build hash to the btm -V output for nightly builds, making it easier to troubleshoot when someone might have obtained a nightly build, and what commit it corresponds to.
Denotes both usage and usage percentage. This also redoes the calculation for percentage to be based on the sum of avail + used, rather than on total, as otherwise we get potentially confusing percentages.
Pulls in the tui-rs grid logic so I can implement custom braille painting logic. We basically "flatten" the layering logic into a single layer by replacing resetting cells if the colour is different. This avoids the multiple allocations if we used multiple layers as intended with tui-rs.
This gives us chart results similar to the current stable version, but with a flamegraph similar to the current master branch.
* other: group all dataset draws in a time chart
We used to draw each data set separately as a new canvas. Now, in one
canvas, we draw all datasets.
Note that this changes how dataset lines are drawn - rather than
drawing one on top of another, it now draws kinda all at once. This
effect is *kinda* a bit better IMO, but it might also look a bit
more cluttered.
* other: optimize truncate_text
Flamegraphs showed that this area seems to be a bit heavy at times with
some inefficient use of iterators and collection. This change should
hopefully optimize this a bit by reducing some collections or
reallocations.
There can also be some further optimizations with less allocations from
callers.
* Reduce some redundant draws
* other: don't use manual map for color name mapping
I actually don't know why I was doing it like that before.
This commit removes the phf crate, as it's not needed anymore.
* update test
* other: deduplicate sorts, sort proc by PID by default
* add proc test
* remove sort in Windows
* fix tree
* fix test
* Remove mut
* Add comment on sorting processes
The throttler is only really needed for scrolls (e.g. free scroll wheels
in Logitech mice), I don't really see it being needed in any other
contexts. Moves/drag is another one I guess but we outright ignore those
events right now.