File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 8
8
CURRENT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
9
9
source " $CURRENT_DIR /helpers.sh"
10
10
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 "
13
13
cpu_metric_file=" $( get_tmux_option " @sysstat_cpu_tmp_dir" " /dev/null" ) /cpu_collect.metric"
14
14
15
15
get_cpu_usage () {
16
16
if is_osx; then
17
17
if command_exists " iostat" ; then
18
18
iostat -w " $refresh_interval " -c " $samples_count " \
19
- | stdbuf -o0 awk ' NR > 2 { print 100-$(NF-3); }'
19
+ | gstdbuf -o0 awk ' NR > 2 { print 100-$(NF-3); }'
20
20
else
21
21
top -l " $samples_count " -s " $refresh_interval " -n 0 \
22
22
| 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 }'
24
24
fi
25
25
elif ! command_exists " vmstat" ; then
26
26
if is_freebsd; then
You can’t perform that action at this time.
0 commit comments