您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 其它文档 > CentOS压力测试工具Tsung安装使用和图形报表生成
CentOS压力测试工具Tsung安装、使用和图形报表生成最近需要测试一下Openfire服务器的性能,然后就选择了用Tsung这个鼎鼎大名的工具来进行测试,只不过Tsung的安装需要CentOS系统,并且,安装过程也不是那么容易的,所以这里参考了一下别人的博客,现在记录如下。转载地址:,如转载请注明原文出处。一、安装安装环境:[plain]viewplaincopy1.LSBVersion::base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch2.DistributorID:CentOS3.Description:CentOSrelease6.5(Final)4.Release:6.55.Codename:Final在安装之前确保安装了以下工具:[plain]viewplaincopy1.yuminstallgcc-y2.yuminstallperl-y3.yuminstallunixODBC4.yuminstallunixODBC-devel下载并安装erlang[plain]viewplaincopy1.#wget=/usr/local/erlang5.#make6.#makeinstall注意:如果出现configure:error:Nocurseslibraryfunctionsfound错误,尝试安装:[plain]viewplaincopy1.yuminstall-yncurses-devel下载并安装Tsung[plain]viewplaincopy1.#wget=/usr/local/tsung--with-erlang=/usr/local/erlang5.#make6.#makeinstall下载并安装perlTemplate,用于生成报告模版[plain]viewplaincopy1.#wget下载并安装gnuplot,用于聊天生成[plain]viewplaincopy1.#yuminstall-ygnuplotgdlibpngzlib注意:安装成后添加erlang、tsung环境变量[plain]viewplaincopy1.#vim/etc/profile2.exportPATH=$PATH:$JAVA_HOME/bin:/usr/local/erlang/bin:/usr/local/tsung/bin:/usr/local/nginx/sbin:$PATH(修改自己实际变量)3.:x保存,退出4.#source/etc/profile5.不报错则成功6.#tsung-v7.#erl-v8.测试二、使用在root文件夹下新建.tsung目录,用于存放log和xml配置,测试配置文件可参考/usr/local/tsung/share/doc/tsung/examples/目录下配置[plain]viewplaincopy1.prename=codeclass=plainstyle=color:rgb(51,51,51);font-size:13px;line-height:19.046875px;#spanstyle=font-family:SimSun;mkdir~/.tsung/span[plain]viewplaincopy1.spanstyle=font-family:SimSun;#cp/usr/local/tsung/share/doc/tsung/examples/http_simple.xml~/.tsung/tsung.xml/span运行,默认执行脚本~/.tsung/tsung.xml配置[plain]viewplaincopy1.#tsungstart2.StartingTsung3.Logdirectoryis:/root/.tsung/log/20140817-1801更多命令:[plain]viewplaincopy1.Usage:tsungoptionsstart|stop|debug|status2.Options:3.-ffilesetconfigurationfile(defaultis~/.tsung/tsung.xml)4.(use-forstandardinput)5.-llogdirsetlogdirectory(defaultis~/.tsung/log/YYYYMMDD-HHMM/)6.-iidsetcontrollerid(defaultisempty)7.-rcommandsetremoteconnector(defaultisssh)8.-senableerlangsmponclientnodes9.-pmaxsetmaximumerlangprocessespervm(defaultis250000)10.-mfilewritemonitoringoutputonthisfile(defaultistsung.log)11.(use-forstandardoutput)12.-Fuselongnames(FQDN)forerlangnodes13.-wwarmupdelay(defaultis10sec)14.-vprintversioninformationandexit15.-6useIPv6forTsunginternalcommunications16.-hdisplaythishelpandexit进入Log目录下可以看到生成的报表信息[plain]viewplaincopy1.#cd/root/.tsung/log/20140817-1801[plain]viewplaincopy1.#ls-a2.match.logtsung_1b.xmltsung_controller@iZ234cp44ihZ.logtsung.log生成图形报表,需要依赖项gnuplot、perl5及template模板[plain]viewplaincopy1.#yum-yinstallperl5gnuplotlibtemplate-perl进入需要生成图形报表的Log目录,如/root/.tsung/log/20140817-1801[plain]viewplaincopy1.#/usr/local/tsung/lib/tsung/bin/tsung_stats.pl2.creatingsubdirectorydata3.creatingsubdirectorygnuplot_scripts4.creatingsubdirectoryimages5.warn,lastinterval(0)notequaltothefirst,usethefirstone(10)6.NodataforEvent7.NodataforErrors[plain]viewplaincopy1.#ls2.datanuplot_scriptsimagesreport.htmltsung_controller@iZ234cp44ihZ.log3.gnuplot.loggraph.htmlmatch.logtsung_1b.xmltsung.log架设一个Http服务器打开report.html就可以看到生成的报表
本文标题:CentOS压力测试工具Tsung安装使用和图形报表生成
链接地址:https://www.777doc.com/doc-2904249 .html