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

Add tmux-ram-usage plugin #220

Merged
merged 4 commits into from
Jul 9, 2023

Conversation

aaronkollasch
Copy link
Contributor

@aaronkollasch aaronkollasch commented Jun 17, 2023

This shows the total RAM usage of the tmux server and all child processes. Requires pstree.

Example (in purple):
image

@ethancedwards8
Copy link
Member

We don't generally allow PRs that require the use of an external tool (except in the case where it's immediately obvious that another binary is required like Kubernetes or Git). If you could find a way to do this without the use of pstree I would merge it.

@aaronkollasch
Copy link
Contributor Author

aaronkollasch commented Jul 9, 2023

I added a fallback to get all child pids of the tmux server in case pstree is not installed.

In testing with a fairly small tmux session (2 panes, one neovim process running w/ LSP), the fallback function is slower than pstree on macOS, taking ~2x the time (162 ms vs. 87 ms), but it took about the same time on Ubuntu Linux (38 ms vs. 30 ms). pstree will also scale better than the fallback as it only involves one ps call instead of multiple pgrep calls.

@ethancedwards8
Copy link
Member

That's a good compromise, thanks for your contribution!

@ethancedwards8 ethancedwards8 merged commit 5e9c4e1 into dracula:master Jul 9, 2023
1 check passed
@aaronkollasch aaronkollasch deleted the feat/tmux-ram-usage branch July 9, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants