CentOS壓力測試最新工具Tsung安裝和圖形報表產生

來源:互聯網
上載者:User

CentOS壓力測試最新工具Tsung安裝和圖形報表產生
一、安裝

安裝環境:

  1. LSBVersion::base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
  2. DistributorID:CentOS
  3. Description:CentOSrelease6.5(Final)
  4. Release:6.5
  5. Codename:Final

在安裝之前確保安裝了以下工具:

  1. yuminstallgcc-y
  2. yuminstallperl-y
  3. yuminstallunixODBC
  4. yuminstallunixODBC-devel

下載並安裝erlang[plain]view plaincopy
  1. #wgethttp://www.erlang.org/download/otp_src_R14B04.tar.gz
  2. #tar-zxvfotp_src_R14B04.tar.gz
  3. #cdotp_src_R14B04
  4. #./configure--prefix=/usr/local/erlang
  5. #make
  6. #makeinstall
注意:如果出現 "configure: error: No curses library functions found"錯誤,嘗試安裝:[plain]view plaincopy
  1. yuminstall-yncurses-devel
下載並安裝Tsung[plain]view plaincopy
  1. #wgethttp://tsung.erlang-projects.org/dist/tsung-1.4.2.tar.gz
  2. #tar-zxvftsung-1.4.2.tar.gz
  3. #cdtsung-1.4.2
  4. #./configure--prefix=/usr/local/tsung--with-erlang=/usr/local/erlang
  5. #make
  6. #makeinstall
下載並安裝perl Template,用於產生報告模版[plain]view plaincopy
  1. #wgethttp://cpan.org/modules/by-module/Template/Template-Toolkit-2.24.tar.gz
  2. #tar-zxvfTemplate-Toolkit-2.24.tar.gz
  3. #cdTemplate-Toolkit-2.24
  4. #perlMakefile.PL
  5. #make
  6. #maketest
  7. #makeinstall
下載並安裝gnuplot,用於聊天產生[plain]view plaincopy
  1. #yuminstall-ygnuplotgdlibpngzlib

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

[plain]view plaincopy
  1. #vim/etc/profile
  2. exportPATH=$PATH:$JAVA_HOME/bin:/usr/local/erlang/bin:/usr/local/tsung/bin:/usr/local/nginx/sbin:$PATH(修改自己實際變數)
  3. :x儲存,退出
  4. #source/etc/profile
  5. 不報錯則成功
  6. #tsung-v
  7. #erl-v
  8. 測試

二、使用在root檔案夾下建立.tsung目錄,用於存放log和xml配置,測試組態檔案可參考/usr/local/tsung/share/doc/tsung/examples/目錄下配置[plain]view plaincopy
  1. <prename="code"class="plain"style="color:rgb(51,51,51);font-size:13px;line-height:19.046875px;">#<spanstyle="font-family:SimSun;">mkdir~/.tsung</span>
[plain]view plaincopy
  1. <spanstyle="font-family:SimSun;">#cp/usr/local/tsung/share/doc/tsung/examples/http_simple.xml~/.tsung/tsung.xml</span>
運行,預設執行指令碼~/.tsung/tsung.xml配置[plain]view plaincopy
  1. #tsungstart
  2. StartingTsung
  3. "Logdirectoryis:/root/.tsung/log/20140817-1801"

更多命令:

[plain]view plaincopy
  1. Usage:tsung<options>start|stop|debug|status
  2. Options:
  3. -f<file>setconfigurationfile(defaultis~/.tsung/tsung.xml)
  4. (use-forstandardinput)
  5. -l<logdir>setlogdirectory(defaultis~/.tsung/log/YYYYMMDD-HHMM/)
  6. -i<id>setcontrollerid(defaultisempty)
  7. -r<command>setremoteconnector(defaultisssh)
  8. -senableerlangsmponclientnodes
  9. -p<max>setmaximumerlangprocessespervm(defaultis250000)
  10. -m<file>writemonitoringoutputonthisfile(defaultistsung.log)
  11. (use-forstandardoutput)
  12. -Fuselongnames(FQDN)forerlangnodes
  13. -wwarmupdelay(defaultis10sec)
  14. -vprintversioninformationandexit
  15. -6useIPv6forTsunginternalcommunications
  16. -hdisplaythishelpandexit

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

[plain]view plaincopy
  1. #cd/root/.tsung/log/20140817-1801
[plain]view plaincopy
  1. #ls-a
  2. match.logtsung_1b.xmltsung_controller@iZ234cp44ihZ.logtsung.log
產生圖形報表,需要依賴項 gnuplot、perl5及template模板

[plain]view plaincopy
  1. #yum-yinstallperl5gnuplotlibtemplate-perl

進入需要產生圖形報表的Log目錄,如/root/.tsung/log/20140817-1801

[plain]view plaincopy
  1. #/usr/local/tsung/lib/tsung/bin/tsung_stats.pl
  2. creatingsubdirectorydata
  3. creatingsubdirectorygnuplot_scripts
  4. creatingsubdirectoryimages
  5. warn,lastinterval(0)notequaltothefirst,usethefirstone(10)
  6. NodataforEvent
  7. NodataforErrors
[plain]view plaincopy
  1. #ls
  2. datanuplot_scriptsimagesreport.htmltsung_controller@iZ234cp44ihZ.log
  3. gnuplot.loggraph.htmlmatch.logtsung_1b.xmltsung.log

架設一個Http伺服器開啟report.html就可以看到產生的報表了.


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.