Code Monkey home page Code Monkey logo

tmux-plugin-sysstat's People

Contributors

rafallukawiecki avatar samoshkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tmux-plugin-sysstat's Issues

cpu.sh is long-running routine which breaks status line refresh behavior

See the background for this issue here: samoshkin/tmux-config#4

In a short, cpu.sh is long running process, which takes $status-refresh-interval-1 seconds to complete. This cause various issues regarding status line refresh behavior:

  • initially, when you start tmux, there is no CPU metric available, so you see cmd ~/.tmux/plugins/sysstat/scripts/cpu.sh not ready message.
  • when cpu.sh completes after 4 seconds, tmux refreshes all widgets in status line (not only cpu). This cause excessive spawns of other widget's scripts (mem, loadavg, swap, any other like tmux-status-online), so refresh behavior of status bar doesn't follow status-refresh-interval settings any more.

The idea for solution is to split cpu.sh logic into:

  • cpu collect routine, which blocks for $interval seconds and runs in background
  • cpu report/print routine, which just examines some location (file) for last CPU metric value and returns it to tmux to display in a status line.

get_cpu_usage() not working on OSX

Hi,

I hope you can help me/us. On my machine I can see that the iostat command defined in the cpu_collect.sh script in the line 18 is hanging.
If I run the script in debug mode I see it hanging here:

 bash scripts/cpu_collect.sh                                               
+++ dirname scripts/cpu_collect.sh
++ cd scripts
++ pwd
+ CURRENT_DIR=/Users/jba/.tmux/plugins/tmux-plugin-sysstat/scripts
+ source /Users/jba/.tmux/plugins/tmux-plugin-sysstat/scripts/helpers.sh
++ get_tmux_option status-interval 5
++ local option=status-interval
++ local default_value=5
+++ tmux show-option -gqv status-interval
++ local option_value=5
++ '[' -z 5 ']'
++ echo 5
+ refresh_interval=5
+ samples_count=60
++ get_tmux_option @sysstat_cpu_tmp_dir /dev/null
++ local option=@sysstat_cpu_tmp_dir
++ local default_value=/dev/null
+++ tmux show-option -gqv @sysstat_cpu_tmp_dir
++ local option_value=/var/folders/4l/7gzvgyn97sb6x09cmt3cn_b8kcxzzd/T/tmp.YbccsN2w
++ '[' -z /var/folders/4l/7gzvgyn97sb6x09cmt3cn_b8kcxzzd/T/tmp.YbccsN2w ']'
++ echo /var/folders/4l/7gzvgyn97sb6x09cmt3cn_b8kcxzzd/T/tmp.YbccsN2w
+ cpu_metric_file=/var/folders/4l/7gzvgyn97sb6x09cmt3cn_b8kcxzzd/T/tmp.YbccsN2w/cpu_collect.metric
+ main
+ get_cpu_usage
+ is_osx
+ read -r value
++ uname
+ '[' Darwin == Darwin ']'
+ command_exists iostat
+ local command=iostat
+ type iostat
+ iostat -w 5 -c 60
+ stdbuf -o0 awk 'NR > 2 { print 100-$(NF-3); }'

If I copy the command in this way iostat -w 5 -c 60 | stdbuf -o0 awk 'NR > 2 { print 100-$(NF-3); }' it works without a problem, but in the script It does not work.

Do you have any idea?
Regards
jolbax

stdbuf and mawk cause an extremely long delay in CPU usage updates

On a system, where mawk is the default awk instead of gawk (for example, Raspbian Stretch), the following will fail to give any output until all the samples are produced. For default settings, this will cause a delay of 60x10 seconds between CPU usage updates.

vmstat -n "$refresh_interval" "$samples_count" \
| stdbuf -o0 awk 'NR>2 {print 100-$(NF-2)}'

I propose two solutions:

  • Replace awk with /usr/bin/gawk everywhere in the code and list gawk as a dependency.
  • Adapt the code so that stdbuf and mawk can produce streaming output.

Cpu percentage not working in Ubuntu 20.04

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.

no output from {sysstat_mem} on Linux Xubuntu 21.10

  • sysstat_cpu outputs 0.0%, no change, but I use {cpu_percentage} from another plugin here.
  • the same config worked before on another device with Linux Ubuntu 20.04.

Am I missing any dependencies on XUbuntu?

Pad percentage outputs

This is just a quick one - I love this wee plugin!

How would I go about padding the CPU and MEM % outputs? I'd like them to always take up the same amount of space.

Load average 0.00 is displayed as 0

It may be rare in most cases, but I sometimes do see a load of 0.00 in my uptime, but it's displayed by this plugin as 0. That seems inconsistent and does not look nice.

Thanks for the great work!

CPU usage always at 0.0%

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.

There is a delay in the CPU utilization display on AMD EPYC CPU

I am running a multiprocessing program.
image

After the program runs, the display stays at 0.0%, and only after a few minutes does it show 9.5%, and it doesn't change for a long time.
Screenshot-20210611185813-439x41

image

Here is the cpu info.

โžœ  ~ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              256
On-line CPU(s) list: 0-255
Thread(s) per core:  2
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        2
Vendor ID:           AuthenticAMD
CPU family:          23
Model:               49
Model name:          AMD EPYC 7H12 64-Core Processor
Stepping:            0
CPU MHz:             1499.957
CPU max MHz:         2600.0000
CPU min MHz:         1500.0000
BogoMIPS:            5199.91
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           32K
L2 cache:            512K
L3 cache:            16384K
NUMA node0 CPU(s):   0-63,128-191
NUMA node1 CPU(s):   64-127,192-255
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate sme ssbd mba sev ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.