统计单一进程IOPS

前端之家收集整理的这篇文章主要介绍了统计单一进程IOPS前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/bin/bash
Pname=$1
ioppPATH=/usr/src/iopp/
Count=$2
if [ "$Pname" = "" ]
        then
        echo "请输入1个进程名,如qemu-kvm"
        exit
fi
if [ "$Count" = "" ]
        then
        Count=5
fi
if [ -d $ioppPATH ]
        then
        if [ ! -f ${ioppPATH}iopp  ]
                then
                cd $ioppPATH && wget http://download.ksyoulee.org/linux/iopp.c
                gcc -o iopp iopp.c
        fi
        else
        mkdir $ioppPATH
        if [ ! -f ${ioppPATH}iopp  ]
                then
                cd $ioppPATH && wget http://download.ksyoulee.org/linux/iopp.c
                gcc -o iopp iopp.c
        fi
fi
${ioppPATH}iopp -c -i 1 $Count > /tmp/iopstest
awk -vpn=$Pname '$0~pn{++i;b+=$4+$5}END{print b/i}' /tmp/iopstest
原文链接:https://www.f2er.com/javaschema/285640.html

猜你在找的设计模式相关文章