【正文】
JMeter用戶手冊 ? 1. 簡介 o 歷史 o 遠(yuǎn)景 ? 2. 新手指南 o 必要條件 ? Java 版本 ? 操作系統(tǒng) o 可選項 ? Java Compiler ? SAX XML 解析器 ? 電子郵件支持 ? SSL 加密 ? JDBC 驅(qū)動程序 ? Apache SOAP o 安裝 ? 下載最新發(fā)布的版本 ? 下載每日構(gòu)建 o 運行 JMeter ? JMeter39。s Classpath ? 使用代理服務(wù)器 ? NonGUI 模式 ? 分布式模式 ? 通過命令行設(shè)置屬性 o Configuring JMeter ? 3. 創(chuàng)建測試計劃 o 添加和刪除元件 o 加載和保存元件 o 配置樹中的元件 o 運行測試計劃 ? 4. 測試計劃中的元件 o 線程組 o 控制器 ? 取樣器 ? 邏輯控制器 o 監(jiān)聽器 o 定時器 o 斷言 o 配置元件 o 前置處理器元件 o 后置處理器元件 ? 5. 創(chuàng)建 Web測試計劃 o 添加用戶 o 添加默認(rèn)的 HTTP請求屬性 o 添加 Cookie支持 o 添加 HTTP請求 o 添加察看 /保存測試結(jié)果的監(jiān)聽器 o 保存測試計劃 o 運行測試計劃 ? 6. 創(chuàng)建高級 Web測試計劃 o Handling User Sessions With URL Rewriting o Using a Header Manager ? 7. 創(chuàng)建數(shù)據(jù)庫測試計劃 o 添加用戶 o 添加 JDBC請求 o 添加察看 /存儲測試結(jié)果的監(jiān)聽器 o 保存測試計劃 o 運行測試計 劃 ? 8. 創(chuàng)建 FTP測試計劃 o 添加用戶 o 添加缺省的 FTP請求屬性 o 添加 FTP請求 o 添加察看 /存儲測試結(jié)果的監(jiān)聽器 o 保存測試計劃 o 運行測試計劃 ? 添加用戶 ? 添加 Login Config Element ? 添加默認(rèn) LDAP請求 ? 添加 LDAP請求 ? 添加察看 /保存測試結(jié)果的監(jiān)聽器 ? 保存測試計劃 ? 運行測試計劃 ? 9. 創(chuàng)建 LDAP測試計劃 ? 10. 創(chuàng)建 Web服務(wù)測試計劃 ? 11. 創(chuàng)建監(jiān)視器測試計劃 ? 12. 遠(yuǎn)程測試 ? 13. 最佳實踐 o [ALL] 限制線程數(shù)目 o [HTTP] 在那兒放置 Cookie管理器 o [HTTP] 在那兒放置授權(quán)管理器 o 使用代理服務(wù)器錄制測試腳本 ? 14. 求助!我的老板想讓我對我們的應(yīng)用做壓力測試! ? 15. 組件參考 ? 16. 函數(shù) ? 17. 詞匯表 1. 簡介 Apache JMeter 是 100%的 Java桌面應(yīng)用程序。用于對軟件做壓力測試(例如 Web應(yīng)用 )。 它可以用于測試靜態(tài)何動態(tài)資源例如靜態(tài)文件、 Java 小服務(wù)程序、 CGI 腳本、 Java 對象、 數(shù)據(jù)庫 , FTP 服務(wù)器 , 等等。 JMeter 可以用于對服務(wù)器、網(wǎng)絡(luò)或?qū)ο竽M巨大的負(fù)載,來在不同壓力類別下測試它們的強度和分析整體性能。 另外, JMeter能夠?qū)?yīng)用程序做衰退測試,通過創(chuàng)建帶有 斷言 的腳本來驗證你的程序返回了你期望的結(jié)果。為了最大限度的靈活性, JMeter允許使用正則表達(dá)式創(chuàng)建斷言。 歷史 Apache Software Foundation 的 Stefano Mazzocchi 是 JMeter的最初開發(fā)人員。他編寫它主要用于測試 Apache JServ的性能(一個后來被 Apache Tomcat項目替代的項目)。我們重新設(shè)計了 JMeter,增強了它的 GUI和添加了功能測試支持。 遠(yuǎn)景 我們希望 看到隨著開發(fā)人員利用插件架構(gòu)的優(yōu)勢, JMeter的能力能夠迅速擴(kuò)展。將來開發(fā)的主要目標(biāo)是使得 JMeter盡可能地變成一個有用的衰退測試工具,而不損失 JMeter地壓力測試能力 2. Getting Started The easiest way to begin using JMeter is to first download the latest production release and install it. The release contains all of the files you need to build and run Web, FTP, JDBC, and JNDI tests. If you want to perform JDBC testing, then you will, of course, need the appropriate JDBC driver from your vendor. JMeter does not e with any JDBC drivers. Next, start JMeter and go through the Building a Test Plan section of the User Guide to familiarize yourself with JMeter basics (for example, adding and removing elements). Finally, go through the appropriate section on how to build a specific type of Test Plan. For example, if you are interested in testing a Web application, then see the section Building a Web Test Plan. The other specific Test Plan sections are for JDBC, FTP, and JNDI. Once you are fortable with building and running JMeter Test Plans, you can look into the various configuration elements (timers, listeners, assertions, and others) which give you more control over your Test Plans. Requirements JMeter requires your puting environment meets some minimum requirements. Java Version JMeter version requires a fully pliant or higher. JMeter and requires a fully pliant or higher. This may seem odd, but we are making a strong effort currently to be patible with the JDK39。s, though it is expected JMeter performs best with or better. Because JMeter uses only standard Java APIs (java.*), please do not file bug reports if your JRE fails to run JMeter because of JRE implementation issues. appears to be buggy, and there are some GUI elements that won39。t work correctly in this JVM. Operating Systems JMeter has been tested and works under Unix (Solaris, Linux, etc) and Windows (98, NT, 2020, XP). Also works on OpenVMS. JMeter is a 100% Java application and should run correctly on any system that has a pliant Java implementation. Optional If you plan on doing JMeter development or want to use Sun39。s Java Standard Extension packages, then you will need one or more optional packages listed below. Java Compiler If you want to build the JMeter source or develop JMeter plugins, then you will need a fully pliant ( for JMeter ) or higher piler. SAX XML Parser JMeter es with Apache39。s Xerces XML parser. You have the option of telling JMeter to use a different XML parser. To do so, include the classes for the thirdparty parser in JMeter39。s classpath, and update the file with the full classname of the parser implementation. Email Support JMeter has limited Email capabilities (it can send based on test results). To enable Email support, add Sun39。s JavaMail packages and the activation packages to JMeter39。s classpath. SSL Encryption To test a web server using SSL encryption (HTTPS), JMeter requires that an implementation of SSL be provided (such as Sun39。s Java Secure Sockets Extension JSSE). Include the necessary encryption packages in JMeter39。s classpath. Also, update by registering the SSL Provider. There is also the , for greater control of certs. Note: if you are running , then you do not have to download JSSE because Sun integrated it into as a standard library. JDBC Driver You will need to add your database vendor39。s JDBC driver to the classpath if you want to do JDBC testing. Apache SOAP Apache SOAP requires and . You need to download and copy these two jar files to your jmeter/lib directory. Once the files are in there, JMeter will automatically pick them up. Installation Installing JMeter is a snap. Specifics depend on which release file you downloaded. Downloading the Latest Release We remend that most users run the latest release. To install a release build, simply unzip the zip/tar file into the directory where you want JMeter to be installed. Provided that you have a JDK corre