`
willvvv
  • 浏览: 328493 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

tsung1.4.2使用(1)-HTTP协议测试

阅读更多

1.安装erlang
tar zvxf otp_src_R15B.tar.gz
cd otp_src_R15B
./configure
make
make install

2.安装tsung
tar zvxf tsung-1.4.2.tar.gz
./configure
make
make install

3.安装perl的Template
tar zvxf Template-Toolkit-2.24.tar.gz
perl Makefile.PL
make
make test
make install

4.安装gnuplot
yum install gnuplot
yum install gd
yum install libpng
yum install zlib

5.确定gnuplot支持png
命令行输入:gnuplot
gnuplot> set terminal
确认支持png,png  PNG images using libgd and TrueType fonts

 

6.执行简单脚本
cd /usr/local/src/tsung-1.4.2/examples
cp http_simple.xml /root/tsung/

vi http_simple.xml

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
  <clients>
    <client host="localhost" use_controller_vm="true"/>
  </clients>
  
  <servers>
    <server host="hiluo.cn" port="80" type="tcp"/>
  </servers>
  
  <load>
  <arrivalphase phase="1" duration="2" unit="minute">
     <users maxnumber="1000" arrivalrate="100" unit="second"/>
   </arrivalphase>
  </load>

  <options>
   <option type="ts_http" name="user_agent">
    <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
    <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
   </option>
  </options>

  <sessions>
  <session name="http-example" probability="100" type="ts_http">
    <request> <http url="/" method="GET" version="1.1"/> </request>
    <request> <http url="/firstPage/img/logo.png" method="GET" version="1.1" if_modified_since="Fri, 14 Nov 2003 02:43:31 GMT"/> </request>
    <request> <http url="/firstPage/img/web_ad_02.png" method="GET" version="1.1" if_modified_since="Fri, 14 Nov 2003 02:43:31 GMT"/> </request>
  </session>
 </sessions>
</tsung>

 

tsung -f http_simple.xml start

输出:

Starting Tsung
"Log directory is: /root/.tsung/log/20120329-2234"

 

待执行完毕, cd /root/.tsung/log/20120329-2234

/usr/local/lib/tsung/bin/tsung_stats.pl 生成报表图形

python -m SimpleHTTPServer  使用python建立一个简单的httpserver,开启端口8000,在本地浏览器输入http://yourserver:8000

 


 


 

  • 大小: 29.6 KB
  • 大小: 31.4 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics