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

Make cpu_collect compatible with OSX and use gstdbuf #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronlna
Copy link

@aaronlna aaronlna commented Jun 24, 2018

#5

Environment

  • OSX Sierra 10.12.6
  • zsh 5.2 (x86_64-apple-darwin16.0)
  • coreutils: stable 8.29 (bottled)

Problems

iostat intervals are buffered-- even while using stdbuf-- until all intervals are complete. This makes the cpu_collect script not update the statusline for TMUX as a refresh happens before all intervals are completed (ie. nothing gets written to the corresponding tmp file).

Changes

  • Use the g prefixed gstdbuf on OSX as to not require modifying the user PATH.
  • Modify refresh_interval and samples_count to complete two samples of iostat per TMUX status line refresh.

@chris-vest
Copy link

This fixed the issue for me. Thank you!

Copy link

@YuLeven YuLeven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this.

@hit9
Copy link

hit9 commented Oct 21, 2018

Will this pr be merged?

@hit9
Copy link

hit9 commented Oct 21, 2018

brew install coreutils gets me gstdbuf installed.

And then CPU outputs ok.

Copy link

@huyvohcmc huyvohcmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please merge this one.

@huyvohcmc huyvohcmc mentioned this pull request Dec 1, 2018
@kleinjm
Copy link

kleinjm commented Dec 1, 2018

@samoshkin please merge this

odrans pushed a commit to odrans/tmux-plugin-sysstat that referenced this pull request Dec 28, 2018
@h0adp0re
Copy link

@samoshkin please consider merging this. Currently I (and probably many others) have resorted to using aaronlna/tmux-plugin-sysstat but it'd be nice to use the main project.

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

Successfully merging this pull request may close these issues.

8 participants