-
Notifications
You must be signed in to change notification settings - Fork 261
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
feature: show running time of processes #801
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes generally look fine, just one comment on whether this can be done without adding a new dependency - if it's just far easier to do or not possible without adding it, let me know.
One other question - how should uptime behave if we are, say, grouping applications with the same name? For example, if I have 10 firefox
processes, do we show the uptime? Take the highest one?
hmm, did |
I think we should show the sum. It's the case when a process have multiple threads, on Linux at least. |
9b7fe90
to
33a91c9
Compare
I removed chrono from dependencies. |
Rebased a bunch of stuff and added tests. Will need to still add searching for time, but I can add that. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #801 +/- ##
==========================================
+ Coverage 28.02% 28.13% +0.11%
==========================================
Files 95 95
Lines 15923 16077 +154
==========================================
+ Hits 4462 4524 +62
- Misses 11461 11553 +92
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Will update documentation in a separate PR later. |
Tested on Windows - noticed that the ones with 19000 days were ~53 years, which lines up with the UNIX epoch - and yep, they were reporting a start time of 0. I might just add a check to zero out anything that reports that (or maybe make the time field an option) to handle it. |
…ime as start time
@all-contributors please add @yshui for code. |
I've put up a pull request to add @yshui! 🎉 |
Is it possible to add a command-line option for this feature? |
@wdscxsj heads up that it might be preferable if you asked stuff like this in either a separate discussion or an issue, just to avoid pinging everyone who worked on this PR. That said, it's currently supported via changing the config (e.g.): [processes]
columns = ["PID", "Name", "CPU%", "Mem%", "R/s", "W/s", "T.Read", "T.Write", "User", "State", "Time"] and I'm not really sure if I want to add it as a command-line flag for now (the command-line interface is already bloated as is). Ideally changing it on runtime will become doable whenever I get to in-app config changing. |
Description
Add a column to the processes table to show the running time of a process
Testing
If relevant, please state how this was tested. All changes must be tested to work:
If this is a code change, please also indicate which platforms were tested:
Checklist
If relevant, ensure the following have been met:
cargo fmt
)README.md
, help menu, etc.)