File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 88CURRENT_DIR=" $(  cd  " $(  dirname " ${BASH_SOURCE[0]} "   ) "   &&  pwd  ) " 
99source  " $CURRENT_DIR /helpers.sh" 
1010
11- refresh_interval=$( get_tmux_option " status-interval"   " 5" ) 
12- samples_count=" 60 " 
11+ refresh_interval=$( get_tmux_option " status-interval"   " 5" ) /2 
12+ samples_count=" 2 " 
1313cpu_metric_file=" $( get_tmux_option " @sysstat_cpu_tmp_dir"   " /dev/null" )  /cpu_collect.metric" 
1414
1515get_cpu_usage () {
1616  if  is_osx;  then 
1717    if  command_exists " iostat" ;  then 
18-        iostat -w " $refresh_interval "   -c " $samples_count "   \
19-          |  stdbuf  -o0 awk ' NR > 2 { print 100-$(NF-3); }' 
18+ 	 iostat -w " $refresh_interval "   -c " $samples_count "   \
19+ 	        |  gstdbuf  -o0 awk ' NR > 2 { print 100-$(NF-3); }' 
2020    else 
2121      top -l " $samples_count "   -s " $refresh_interval "   -n 0 \
2222        |  sed -u -nr ' /CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p'   \
23-         |  stdbuf  -o0 awk ' { print 100-$0 }' 
23+         |  gstdbuf  -o0 awk ' { print 100-$0 }' 
2424    fi 
25-   elif  !   command_exists " vmstat" ;  then 
25+   elif  command_exists " vmstat" ;  then 
2626    if  is_freebsd;  then 
2727      vmstat -n " $refresh_interval "   -c " $samples_count "   \
2828        |  stdbuf -o0 awk ' NR>2 {print 100-$(NF-0)}' 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments