美文网首页
CPU降频监测

CPU降频监测

作者: 小御茶 | 来源:发表于2022-08-10 11:05 被阅读0次

    检查和记录CPU频率脚本,用于辅助监测CPU降频问题

    mkdir allfreInfo
    touch avefreInfo.log
    num=`cat /proc/cpuinfo | grep -i mhz | awk '{print $4}' | wc -l`
    times=1
    while true;do
        
        total=0
        date=`date +%Y-%m-%d-%H:%M:%S`
        touch allfreInfo/$date-allfreInfo.log
        echo "$date" >> allfreInfo/$date-allfreInfo.log
        turbostat -q -n 1 -i 1 -o allfreInfo/$date-allfreInfo.log
        for i in `cat /proc/cpuinfo | grep -i mhz | awk '{print $4}'`;do
            total=`echo "scale=1;$total + $i" | bc`
        done
        average=`echo "scale=1;$total / $num" | bc`
        echo "$date : $average" >> avefreInfo.log
        sleep 300s
        echo "the $times times check finished...."
        let times+=1
    done
    
    

    相关文章

      网友评论

          本文标题:CPU降频监测

          本文链接:https://www.haomeiwen.com/subject/vjwzwrtx.html