[OpenSource] AWBot-一款小巧的测试Web站点的工具

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

作者:Fenng

日期:Oct 09 2004

http://www.dbanotes.net

AWBot 简介

AWBot 是一款易用的测试Web站点的小工具。站点在http://awbot.sourceforge.net 。该项目是 AWstats 项目的辅助项目。

AWbot 的功能简单的说,可以模拟用户访问站点的行为,测试站点的响应度和负载压力,并可进行基准测试。

具体来讲,AWbot 具有如下特性:

易用性好.

支持基本的HTTP验证请求.

可以在测试前后制定不同预提交任务(外部脚本,SQL命令等).

可以检查每个HTML页面的HTTP请求的结果以验证是否内容包含特性的关键字或是要解析的值.

可以动态定义用以测试的URL与参数.

可以多会话运行来测试负载压力.

针对每个页面报告错误,响应时间和平均响应时间

开放源码 (GNU General Public License)

AWBot 具有 XML PAD( Portable Application Description).

其他一些特性

安装需求

AWBot要求系统必须满足如下要求:

系统必须要由Perl的支持,可运行Perl脚本。否则的话,要下载Perl : ActivePerl (Win32) 或者在 Perl.com (Unix/Linux/Other).

必须添加Perl模块Time::HiRes,使得 时间 可以取到毫秒.

如果要执行提交前SQL命令的话,要添加DBI/DBD 数据库 perl 模块.

安装参考

以下是一份安装Log:

#############Installing Time::HiRes####################

#下载 Time::HiRes 模块 注意:文件名字和连接可能会有变化

wget http://www.cpan.org/modules/by-module/Time/Time-HiRes-1.65.tar.gz

tar -zxvf Time-HiRes-1.65.tar.gz

cd Time-HiRes-1.65

perl Makefile.PL

make

#如果有错误信息的话表明你的环境变量有所不同,需要进行如下操作

export LC_ALL=C

perl Makefile.PL

make

make install

#安装 Time::HiRes 完毕

##############Installing AWBot###################### wget http://awbot.sourceforge.net/files/awbot.tgz

#解压缩

tar -zxvf awbot.tgz

cd awbot-1.0/

#把配置文件模板复制一份:

cp awbot.test.conf awbot.dbanotes.conf

vi awbot.dbanotes.conf

#进行基本配置:

OUTPUTDIR = "./output" # 输出文件的位置(必须存在并可写)

SERVER = "www.dbanotes.net" # 待测试的站点域名

#USER = "test" # 如果Web应用程序需要认证的话,在这里添入用户名字,并去掉注释

#PASSWORD = "test" # 如果Web应用程序需要认证的话,在这里添入用户密码,并去掉注释

rd that awbot will use

BOTNAME = "AWBot" # String value to force bot name used in the user agent string

DELAY = 0 # Delay beetween each HTTP request (-1 wait a key, 0 no delay,

n number of seconds)

MAXSIZE = 0 # Maximum size of HTTP response (0 = no limit)

TIMEOUT = 120 # Timeout (when waiting for a server response after sending a request)

LANG = "en" # 输出内容的语言

AWBot脚本还可以有很多参数选项,我们来看看参数:

# perl awbot.pl

----- awbot 1.0 (build 1.3) -----

Advanced Web Bot is a tool to test a web server.

Usage: awbot.pl -config=testconfigfile [options]

Where options are:

-server=xxx Overwrite SERVER value of testconfig file.

-user=xxx Overwrite USER value of testconfig file.

-password=xxx Overwrite PASSWORD value of testconfig file.

-delay=n Overwrite DELAY value of testconfig file.

-timeout=n Overwrite TIMEOUT value of testconfig file.

-loadimages Load image files.

-nostopiferror Awbot continues with next test when an error occurs.

-prepareonly Only execute pre-actions.

-executeonly Do not execute any pre-actions nor post-actions.

-id Output file name contains process ID number.

-verbose Output file is also reported on std output (screen).

-silent Nothing on std output (screen).

-debug=X To add debug informations lesser than level X

Now supports/detects:

Several predefined post-test or pre-test actions (Scripts, SQL request...)

Web sites with Basic HTTP/Proxy authentication

Easy to configure (one config file)

Configuration and Test plan can be defined dynamically (using variables

catched from a previous test)

Possible use of several simultanous sessions (with awbotlaunch.pl)

参数的解释比较详细,要不怎么说AWBot是个简单易用的工具呢。

基本用法

# perl awbot.pl -config=awbot.dbanotes.conf -verbose

TEST awbot 1.0 (build 1.3)

---------------------------

Config file: awbot.dbanotes.conf

Server: www.dbanotes.net - User: - Delay: 0

Botname: AWBot - TimeOut: 120 - MaxSize: 0

Date: 2004-10-13 13:13:15

Process ID: 21139

PRE ACTIONS

---------------------------

ACTIONS

---------------------------

2004/10/13-13:13:15:534 URL 1 - http://www.dbanotes.net/

---> OK - 2771.027 ms

POST ACTIONS

---------------------------

SUMMARY

---------------------------

Total requests to do: 1

Total requests sent: 1 (1 answered)

Total requests duration: 2771.027 ms

Average requests response time: 2771 ms/request

Total Check Yes: 0/0 No: 0/0

Faster request response time: URL 1 - 2771 ms

Slower request response time: URL 1 - 2771 ms

URL 1 - Duration: 2771 ms - Cumul: 2771 ms - Check Yes: 0 / 0 No: 0 / 0

参考信息

AWbot http://awbot.sourceforge.net

AWBot的官方文档 http://awbot.sourceforge.net/docs/

若SourceForge不可访问,可在本站浏览联机文档 http://www.dbanotes.net/awbot/awbot.sourceforge.net/docs/index.html

本文作者

Fenng,某美资公司DBA,业余时间混迹于各数据库相关的技术论坛且乐此不疲。目前关注如何利用ORACLE数据库有效地构建企业应用。对Oracle tuning、troubleshooting有一点研究。

个人技术站点: http://www.dbanotes.net/ 。可以通过电子邮件 dbanotes@gmail.com 联系到他。

原文出处

http://www.dbanotes.net/awbot/AWBot.htm

回首页

All Articles (by Fenng) are licensed under a Creative Commons License.

I would welcome any feedback. Please send questions, comments or corrections to dbanotes@gmail.com

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有