Skip to content
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

Allow summing-collapse of a process/thread tree #920

Open
eyalroz opened this issue Jan 12, 2022 · 10 comments
Open

Allow summing-collapse of a process/thread tree #920

eyalroz opened this issue Jan 12, 2022 · 10 comments
Labels
new feature Completely new feature

Comments

@eyalroz
Copy link

eyalroz commented Jan 12, 2022

I often want to see the total memory and CPU usage for some process and its subprocess (e.g. Firefox, Chromium). I can htop to consider all threads of a process together (although even that is a global setting) - but I can't do that for processes. I wish that, in tree view, when I collapse a node (with the - key) - I will see the sum of the memory usage percentage, CPU usage percentage etc of its entire subtree.

Now, I realize that for some columns, summation may not be obvious (e.g. if a process started T seconds ago and runs N subprocesses after T/2 seconds, it's not clear whether the time is (N+1)*T/2 or T), or not relevant, but any reasonable default will do AFAIAC. Plus people can always file other bugs about that later on...

@fasterit
Copy link
Member

You can collapse a tree branch with - (minus key).
This will - however - not "sum" memory or CPU usages at the moment.

@eyalroz eyalroz changed the title Allow collapsing a process/thread tree (e.g. with Enter) Allow summing-collapse of a process/thread tree Jan 12, 2022
@eyalroz
Copy link
Author

eyalroz commented Jan 12, 2022

@fasterit : Rephrasing to emphasize the main request.

@fasterit
Copy link
Member

Is this request substantially different from #301 / #303?

@eyalroz
Copy link
Author

eyalroz commented Jan 12, 2022

@fasterit : #303 is about global merging, with no option of expansion. #301 is also global, and would not be affected by collapsing; also, it involves merging more than is currently being merged, while my proposal is orthogonal of that. That being said - if #301 were implemented I would not bother to file this issue.

@Explorer09
Copy link
Contributor

@fasterit This feature request is different from #301. This is more about usability improvement for tree view when a process/thread "subtree" is collapsed.

  • When a process group is collapsed this way, the CPU time and memory usage should sum up and display the total for the group, perhaps with a different text color to indicate it's a summary result.
  • The "state" / "S" flag might also need to be updated for the summary. I.e. when a child process in a group is Running, the whole collapsed process subtree should show "R" in its state despite the parent process Sleeping.
  • For "user" column a collapsed subtree might need to show "(multi)" if there are child process owned by multiple users.

@Catzy44
Copy link

Catzy44 commented Jul 4, 2023

i want this feature so much i could create PR
but my main lang is Java, not C
COULD SOMEBODY SUMMON C ENGINEER!?

@langfield
Copy link

langfield commented Oct 12, 2023

I would also love it if the default behavior was changed so that the percentages were cumulative! 🙏🏻

@xrchz
Copy link

xrchz commented Jan 12, 2024

I want this too.

@lynxthecat
Copy link

lynxthecat commented Feb 28, 2024

Chance of this getting implemented in the next six months?

There are many situations in which this would be helpful such as ascertaining total CPU usage of a bash script that spawns multiple background processes:

image

@BenBE
Copy link
Member

BenBE commented Feb 28, 2024

Chance of this getting implemented in the next six months?

That depends on how many pull-requests we get for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Completely new feature
Projects
None yet
Development

No branches or pull requests

8 participants