CentOS壓力測試工具Tsung安裝、使用和圖形報表產生

來源:互聯網
上載者:User

標籤:

一、安裝前檢查環境

1、查看環境:

[[email protected] bin]#  lsb_release -aLSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarchDistributor ID:    CentOSDescription:    CentOS release 6.4 (Final)Release:    6.4Codename:    Final

2、確保安裝了以下工具:

yum install gcc -y  yum install perl -y  yum install unixODBC  yum install unixODBC-devel 
二、安裝

1、下載並安裝erlang

[[email protected] ~]#cd /usr/local[[email protected] local]#mdir -p erlang[[email protected] local]# wget http://www.erlang.org/download/otp_src_R14B04.tar.gz [[email protected] local]# tar -zxvf otp_src_R14B04.tar.gz  [[email protected] local]# cd otp_src_R14B04  [[email protected] otp_src_R14B04]# ./configure --prefix=/usr/local/erlang  [[email protected] otp_src_R14B04]# make  [[email protected] otp_src_R14B04]# make install  

注意:如果出現 "configure: error: No curses library functions found "錯誤,嘗試安裝:

[[email protected] otp_src_R14B04]#yum install -y ncurses-devel 

 

2、下載並安裝Tsung

[[email protected] ~]#cd /usr/local[[email protected] local]#mkdir -p tsung
[[email protected] local]# wget http://tsung.erlang-projects.org/dist/tsung-1.4.2.tar.gz [[email protected] local]# tar -zxvf tsung-1.4.2.tar.gz [[email protected] local]# cd tsung-1.4.2 [[email protected] tsung-1.4.2]# ./configure --prefix=/usr/local/tsung --with-erlang=/usr/local/erlang [[email protected] tsung-1.4.2]# make [[email protected] tsung-1.4.2]# make install

 

3、下載並安裝perl Template,用於產生報告模版

[[email protected] ~]#cd /usr/local[[email protected] local]# wget http://cpan.org/modules/by-module/Template/Template-Toolkit-2.24.tar.gz  [[email protected] local]# tar -zxvf Template-Toolkit-2.24.tar.gz  [[email protected] local]# cd Template-Toolkit-2.24  [[email protected] Template-Toolkit-2.24]# perl Makefile.PL  [[email protected] Template-Toolkit-2.24]# make  [[email protected] Template-Toolkit-2.24]# make test  [[email protected] Template-Toolkit-2.24]# make install  

 

4、下載並安裝gnuplot,用於聊天產生

[[email protected] local]#yum install -y gnuplot gd libpng zlib 

 

三、安裝後設定環境變數

安裝成後添加erlang、tsung環境變數

[[email protected] local]# vim /etc/profile   export PATH=$PATH:$JAVA_HOME/bin:/usr/local/erlang/bin:/usr/local/tsung/bin:/usr/local/nginx/sbin:$PATH(修改自己實際變數)  :wq儲存,退出  [[email protected] local]# source /etc/profile   不報錯則成功  [[email protected] local]# tsung -v   Tsung version 1.4.2[[email protected] local]# erl -v  Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]Eshell V5.8.5 (abort with ^G)1>

 

四、使用並產生報表

1、在root檔案夾下建立.tsung目錄,用於存放log和xml配置,測試組態檔案可參考/usr/local/tsung/share/doc/tsung/examples/目錄下配置

[[email protected] local]#mkdir ~/.tsung[[email protected] local]#cp /usr/local/tsung/share/doc/tsung/examples/http_simple.xml ~/.tsung/tsung.xml

2、運行,預設執行指令碼~/.tsung/tsung.xml配置

[[email protected] local]# tsung startStarting Tsung"Log directory is: /root/.tsung/log/20150311-0536"

3、進入Log目錄下可以看到產生的報表資訊

[[email protected] 20150311-0536]# cd /root/.tsung/log/20150311-0536[[email protected] 20150311-0536]# ls -a.  ..  match.log  [email protected]  tsung.log  tsung.xml

4、進入需要產生圖形報表的Log目錄,如/root/.tsung/log/20150311-0536

[[email protected] 20150311-0536]# /usr/local/tsung/lib/tsung/bin/tsung_stats.pl creating subdirectory data creating subdirectory gnuplot_scripts creating subdirectory images No data for SessionNo data for PerfsNo data for TransactionsNo data for MatchNo data for EventNo data for AsyncNo data for Sizesize_rcv is equal to 0 !size_sent is equal to 0 ![[email protected] 20150311-0536]# lsdata  gnuplot.log  gnuplot_scripts  graph.html  images  match.log  report.html  [email protected]  tsung.log  tsung.xml

5、將report.html拖到windows系統中,直接開啟即可查看。

 

CentOS壓力測試工具Tsung安裝、使用和圖形報表產生

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.