prefix=/srv/data/fitgatetrackmain/logs/
lines=10
drop_head=3
let lines=
l
i
n
e
s
+
lines+
lines+drop_head
list=(pm2 list | grep fitgateTrack | grep -v stopped | awk -F' ' '{print $4}'
)
num=0
sleep 1
load=uptime | awk -F' ' '{print $10}'
i=0
while true
do
if [[ $i == $lines ]]; then
break
fi
let i++
#f=grep 'cpu MHz' /proc/cpuinfo | awk -F' ' '{print $4}'
#echo $f lscpu | grep 'CPU MHz' | awk -F' ' '{print $3}'
freq=$freq" "grep 'cpu MHz' /proc/cpuinfo | awk -F' ' '{print $4}' | awk '{sum+=$1} END {print sum/NR}'
load=$load" "uptime | awk -F' ' '{print $10}'
temp=$temp" "sensors | grep Package | sed -e 's/.*: *+\([0-9]*\)\..*/\1/g'
f=`echo $freq | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'`
l=`echo $load | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'`
t=`echo $temp | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'`
if (($i < $drop_head)); then
freq=
load=
temp=
sleep 1
continue
fi
echo `date`, $i, $f, $l, $t
sleep 1
done
freq=echo $freq | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
load=echo $load | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
temp=echo $temp | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
fps=
decodetime=
facetime=
for port in “
l
i
s
t
[
@
]
"
;
d
o
l
e
t
n
u
m
+
+
l
o
g
=
{list[@]}"; do let num++ log=
list[@]";doletnum++log=prefix$port”.log"
#tail -10 fitgateTrack-11104.log | awk -F’ |,’ '{print $4,$6,KaTeX parse error: Expected 'EOF', got '}' at position 2: 8}̲' fps=fsp" "tail -10 $log | awk -F' |,' '{print $4}' | awk '{sum+=$1} END {print sum/NR}'
decodetime=$decodetime" "tail -10 $log | awk -F' |,' '{print $6}' | awk '{sum+=$1} END {print sum/NR}'
facetime=$facetime" "tail -10 $log | awk -F' |,' '{print $8}' | awk '{sum+=$1} END {print sum/NR}'
done
fps=echo $fps | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
decodetime=echo $decodetime | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
facetime=echo $facetime | tr ' ' '\n' | awk '{sum+=$1} END {print sum/NR}'
echo $num $fps $decodetime $facetime $freq $load $temp