samoshkin / tmux-plugin-sysstat

Prints CPU usage, memory & swap, load average, net I/O metrics in Tmux status bar
MIT License
157 stars 48 forks source link

Cpu percentage not working in Ubuntu 20.04 #21

Open smr97 opened 4 years ago

smr97 commented 4 years ago

Hi, cpu usage is always at 0.0%. I reduced sampling time to 1 second and ran a build process. This still doesn't change the output. I also tried to redirect the CPU file to ~/cpu_shit folder (just in case the default temp folder is not working due to a permissions issue). I see no files being written to this folder. Does anyone experience this issue? I installed via tmp.

adams-family commented 4 years ago

Hi, I get the following on Debian 10:

image

Is it a bug or do I have something wrong?

My .tmux.conf:

# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf

# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+

# enable mouse scroll
set -g mouse on

set-option -g status-position bottom

set -g @plugin 'samoshkin/tmux-plugin-sysstat'

set -g status-right "#{sysstat_cpu} | #{sysstat_mem} | #{sysstat_swap} | #{sysstat_loadavg} | #[fg=cyan]#(echo $USER)#[default]@#H"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
smr97 commented 4 years ago

set -g @plugin 'tmux-plugins/tmux-cpu' this worked for me out of the box ;)

lucasrangit commented 4 years ago

Same issue on Raspbian GNU/Linux 10 (buster). Blank values for CPU, MEM, SW. load averages show up as non-zero.

$ tmux -V
tmux 2.8
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

CPU and MEM values show up if installed with tmux-config but they don't appear to change. CPU is still at 100% and MEM is at 16%.

matusbielik commented 3 years ago

Also not working on Pop!_OS with latest tmux :disappointed: Placeholders are replaced by blank values

$ tmux -V
tmux next-3.3

$ lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 20.10
Release:    20.10
Codename:   groovy

too bad, this is exactly what I was looking for!

@samoshkin is there any chance this will be fixed or is this plugin deprecated?

firemiles commented 2 years ago

I try to add fflush() in script cpu_collect.sh after awk print fix this issue