* 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
* 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: 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
* 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>
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
* refactor: move to new data table implementation
* more work towards refactor
* move disk and temp over, fix longstanding bug with disk and temp if removing the last value and selected
* work towards porting over CPU
work towards porting over CPU
fix typo
partially port over cpu, fix some potentially inefficient concat_string calls
more work towards cpu widget migration
some refactoring
* sortable data
sortable data
more refactoring
some sort refactoring
more refactoringgggg
column refactoring
renaming and reorganizing
more refactoring regarding column logic
add sort arrows again
* move over sort menu
* port over process
port over process
precommit
temp
temp two, remember to squash
work
fix broken ltr calculation and CPU hiding
add back row styling
temp
fix a bunch of issues, get proc working
more fixes around click
fix frozen issues
* fix dd process killing
* revert some of the persistent config changes from #257
* fix colouring for trees
* fix missing entries in tree
* keep columns if there is no data
* add and remove tests
* Fix ellipsis
* deps: update sysinfo to 0.26.2
This dependency update has some nice things in store for us:
- MacOS M1 temperature support
- Bevy of bug fixes
* update documentation
* some fixes
* ci: spring cleaning of completions autogen
This commit changes a few things/cleans up stuff:
- Completion and manpage generation now drops the files off in
`./target/tmp/bottom` rather than arbitrarily in the build directory.
This was originally done because I was lazy and just needed it to work
in CI, but it's kinda gross if you want to build the manpages in your
own directory.
- CI was updated to handle this.
- Only run if the `BTM_GENERATE` env var is actually non-empty.
* docs: update for manpage/completion gen
* ci: auto delete autogen comp/manpage dir
* ci: fix incorrect mv for autogen
The mv was too late, should be earlier in the workflow.
* ci: specify shell in autogen delete
* docs: more updates to manpage/comp docs
* ci: unify env vars
* ci: skip autogen on build-msi
* freebsd clippy
* add arc support
* Code Review: moved runtime cfg checks to compile time and formatting
* remove compile platform checks
* add zfs feature flag to get_arc_data
* WIP FreeBSD support
* Implement get_cpu_data_list for FreeBSD
* Implement disks for FreeBSD
It doesn't work though as sysinfo doesn't make the device name available.
* Use libxo to read process cpu info on FreeBSD
* Populate get_io_usage with libxo too
Actual I/O stats still aren't populated though as there's not an
easy source for them.
* Share more processes code between macos and freebsd
* Extract function for deserializing libxo output on FreeBSD
* Implement filtering of disks in FreeBSD
* Clean up memory data collection
* Update module docs
This consolidates all the time graph drawing to one main location, as well
as some small improvements. This is helpful in that I don't have to
reimplement the same thing across three locations if I have to make one
change that in theory should affect them all. In particular, the CPU
graph, memory graph, and network graph are all now using the same,
generic implementation for drawing, which we call (for now) a component.
Note this only affects drawing - it accepts some parameters affecting style
and labels, as well as data points, and draw similarly to how it used to
before. Widget-specific actions, or things affecting widget state,
should all be handled by the widget-specific code instead. For example,
our current implementation of x-axis autohide is still controlled by the
widget, not the component, even if some of the code is shared. Components
are, again, only responsible for drawing (at least for now). For that
matter, the graph component does not have mutable access to any form of
state outside of tui-rs' `Frame`. Note this *might* change in the
future, where we might give the component state.
Note that while functionally, the graph behaviour for now is basically
the same, a few changes were made internally other than the move to
components. The big change is that rather than using tui-rs' `Chart`
for the underlying drawing, we now use a tweaked custom `TimeChart`
tui-rs widget, which also handles all interpolation steps and some extra
customization. Personally, I don't like having to deviate from the
library's implementation, but this gives us more flexibility and allows
greater control. For example, this allows me to move away from the old
hacks required to do interpolation (where I had to mutate the existing
list to avoid having to reallocate an extra vector just to insert one
extra interpolated point). I can also finally allow customizable
legends (which will be added in the future).
Adds the asset for the manpage to cargo deb config. Also moves the generated manpage file to a .1.gz file. Also, moves back to a build script since that was causing some issues for the automatic Cargo.toml fields detection for manpage and completion generation.
To prevent compilation from happening every time, and only in CI, we use an env var to avoid generation steps.
Adds manpage generation to the build process, as well as following the xtask concept of adding additional build scripts that only need to run on deploy/nightly as opposed to `build.rs`. Note this doesn't follow the recommended method of using workplaces because I don't really want to shift the entire repo structure just for this.
More on xtask: https://github.com/matklad/cargo-xtask