performance test

2008-04-09 04:06:04来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

对软件进行 性能测试,需要写一个脚本来作驱动。

基本要求如下:

(1)每秒钟能并发M次;

(2)可以连续不断地执行N秒;

#需要并发执行的脚本 driver.pl

#每秒并发执行M次的脚本 MperSec.ksh

#! /usr/bin/ksh

# usage: MperSec.ksh M

MperSec= # is how many times per second

time{
for ((i=1;i<=$MperSec;i ))
do
driver.pl & # & means let the script run in background
done

wait

}

#连续执行N秒的脚本 NSecs.ksh

#! /usr/bin/ksh

#usage: NSecs.ksh N M

NSecs=

MperSecond=

for ((i=1;i<=$NSecs;i ))
do
MperSec.ksh& # & means let the script run in background

sleep 1
done

#How to invoke the whole test process

NSecs.ksh 7200 6 |tee test.log

#----------------经过测试的版本----------------------------------

# Solaris 9 ksh

#! /usr/bin/ksh

# usage: MperSec.ksh M

MperSec="" # is how many times per second

function func
{
i=1
while [ "$i" -lt "$MperSec" ]
do
driver.pl & # & means let the script run in background
i=$(($i 1))
done

wait
}

time func
#(time func) 2>&1|awk '/real/{print }'

#! /usr/bin/ksh

# usage: MperSec.ksh M

MperSec="" # is how many times per second

function func
{
i=1
while [ "$i" -lt "$MperSec" ]
do
ipqueryClient.pl & # & means let the script run in background
i=$(($i 1))
done

wait
}

time func

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:麻将游戏开发

下一篇:Base ClearCase与ClearQuest的集成