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 usage always at 0.0% #10

Closed huyvohcmc closed 5 years ago

huyvohcmc commented 5 years ago

OS: macOS mojave 10.14 Tmux: 2.8

get_cpu_usage_or_collect() {
  local collect_cpu_metric="$cpu_tmp_dir/cpu_collect.metric"

  # read cpu metric from file, otherwise 0 as a temporary null value, until first cpu metric is collected
  [ -f "$collect_cpu_metric" ] && cat "$collect_cpu_metric" || echo "0.0"

  start_cpu_collect_if_required >/dev/null 2>&1
}

Looks like the plugin never read cpu metric from file in my case, because the CPU usage is always 0.0% while Ram usage did show real time value. Here is my minimum configuration:

set -g status-left " Sess: #S / CPU: #{sysstat_cpu} / Mem: #{sysstat_mem} "

set -g @sysstat_cpu_view_tmpl "#{cpu.pused}"
set -g @sysstat_mem_view_tmpl "#{mem.pused}"

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

My full Tmux config file can be found at https://github.com/huyvohcmc/dotfiles/blob/master/tmux.conf.

kleinjm commented 5 years ago

I'm having the same issue

huyvohcmc commented 5 years ago

@kleinjm This PR will help you https://github.com/samoshkin/tmux-plugin-sysstat/pull/7

kleinjm commented 5 years ago

Thanks @huyvohcmc

huyvohcmc commented 5 years ago

Looks like this project is left unmaintained.