⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get-started.html

📁 测试工具jmeter可用来进行性能测试
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a href="#classpath">
classpath
</a>
 if you want to do JDBC testing.
Make sure the file is a jar file, not a zip.

</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="opt_soap"><strong>2.2.6 Apache SOAP</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Apache SOAP requires mail.jar and activation.jar. You need to download and copy these two jar files to your 
<b>
jmeter/lib
</b>
 directory. Once the files are in there, JMeter will automatically pick them up.
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="opt_beanshell"><strong>2.2.7 BeanShell</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
To run the BeanShell function or any of the BeanShell test elements (sampler, timer etc),
 you need to download the beanshell jar from 
<a href="http://www.beanshell.org/">
http://www.beanshell.org/
</a>
 and copy the jar file to the 
<b>
jmeter/lib directory
</b>
, where JMeter will automatically pick it up.
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="libraries_activemq"><strong>2.2.7 Libraries for ActiveMQ 3.0</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
See 
<a href="http://activemq.apache.org/initial-configuration.html">
http://activemq.apache.org/initial-configuration.html
</a>

for details.

</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
See the 
<a href="#classpath">
JMeter Classpath
</a>
 section for more details on installing additional jars.

</td></tr>
</table></p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="install"><strong>2.3 Installation</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Note: avoid installing JMeter in a path with spaces in the name.  
This causes problems for remote testing.

</td></tr>
</table></p>
<p>
We recommend that most users run the 
<a href="http://jakarta.apache.org/site/downloads/index.html">
latest release
</a>
.
</p>
<p>
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 JRE/JDK correctly installed
and the JAVA_HOME environment variable set, there is nothing more for you to do.
</p>
<p>

The installation directory structure should look something like this (for version 2.3.1):

<pre>

jakarta-jmeter-2.3.1
jakarta-jmeter-2.3.1/bin
jakarta-jmeter-2.3.1/docs
jakarta-jmeter-2.3.1/extras
jakarta-jmeter-2.3.1/lib/
jakarta-jmeter-2.3.1/lib/ext
jakarta-jmeter-2.3.1/lib/junit
jakarta-jmeter-2.3.1/printable_docs

</pre>

You can rename the parent directory (e.g. jakarta-jmeter-2.3.1) if you want, but do not change any of the sub-directory names.
The path to the parent directory should not contain any spaces; if it does, then you may have problems running client-server mode.

</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="running"><strong>2.4 Running JMeter</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<br>
</br>
<p>
To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file.
These files are found in the bin directory.
After a short pause, the JMeter GUI should appear. 

</p>
<p>

There are some additional scripts in the bin directory that you may find useful.
Windows script files (the .CMD files require Win2K or later):

<ul>


<li>
jmeter.bat - run JMeter (in GUI mode by default)
</li>


<li>
jmeter-n.cmd - drop a JMX file on this to run a non-GUI test
</li>


<li>
jmeter-n-r.cmd - drop a JMX file on this to run a non-GUI test remotely
</li>


<li>
jmeter-t.cmd - drop a JMX file on this to load it in GUI mode
</li>


<li>
jmeter-server.bat - start JMeter in server mode
</li>


</ul>

Note: the special name LAST can be used with jmeter-n.cmd, jmeter-t.cmd and jmeter-n-r.cmd
and means the last test plan that was run interactively.

</p>
<p>

Un*x script files; should work on most Linux/Unix systems.

<ul>


<li>
jmeter - run JMeter (in GUI mode by default)
</li>


<li>
jmeter-server - start JMeter in server mode
</li>


</ul>


</p>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="classpath"><strong>2.4.1 JMeter's Classpath</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
JMeter automatically finds classes from jars in the following directories:
</p>
<ul>


<li>
JMETER_HOME/lib - used for utility jars
</li>


<li>
JMETER_HOME/lib/ext - used for JMeter components and add-ons
</li>


</ul>
<p>
If you have developed new JMeter components,
then you should jar them and copy the jar into JMeter's 
<b>
lib/ext
</b>
 directory.
JMeter will automatically find JMeter components in any jars found here.

</p>
<p>
Support jars (libraries etc) should be placed in the 
<b>
lib
</b>
 directory.
</p>
<p>
If you don't want to put the extension jars in the 
<b>
lib/ext
</b>
 directory,
then define the property 
<b>
search_paths
</b>
 in jmeter.properties.
Do not use lib/ext for utility jars; it is only intended for JMeter components.

</p>
<p>

Other jars (such as JDBC, JavaMail, Beanshell and any other support libaries needed by the JMeter code)
 should be placed in the 
<b>
lib
</b>
 directory - not the 
<b>
lib/ext
</b>
 directory
</p>
<p>
Note: JMeter will only find .jar files, not .zip.
</p>
<p>
You can also install utility Jar files in $JAVA_HOME/jre/lib/ext, or (since 2.1.1) you can set the property 
<b>
user.classpath
</b>
 in jmeter.properties
</p>
<p>
Note that setting the CLASSPATH environment variable will have no effect.
This is because JMeter is started with "java -jar", 
and the java command silently ignores the CLASSPATH variable, and the -classpath/-cp options when -jar is used. 
[This occurs with all Java programs, not just JMeter.]
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="proxy_server"><strong>2.4.2 Using a Proxy Server</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
If you are testing from behind a firewall/proxy server, you may need to provide JMeter with
the firewall/proxy server hostname and port number.  To do so, run the jmeter.bat/jmeter file
from a command line with the following parameters:
</p>
<p>

-H [proxy server hostname or ip address]
<br>
</br>

-P [proxy server port]
<br>
</br>

-N [nonproxy hosts] (e.g. *.apache.org|localhost)
<br>
</br>

-u [username for proxy authentication - if required]
<br>
</br>

-a [password for proxy authentication - if required]
<br>
</br>


</p>
<p>
<b>
Example
</b>
: jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost
</p>
<p>
Alternatively, you can use --proxyHost, --proxyPort, --username, and --password
</p>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>JMeter also has its own in-built 
<a href="../usermanual/component_reference.html#HTTP_Proxy_Server">HTTP Proxy Server</a>
,
which can be used for recording HTTP (but not HTTPS) browser sessions.
This is not to be confused with the proxy settings described above, which are used when JMeter makes HTTP or HTTPS requests itself.
</td></tr>
</table></p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="non_gui"><strong>2.4.3 Non-GUI Mode (Command Line mode)</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
For non-interactive testing, you may choose to run JMeter without the GUI. To do so, use
the following command options
</p>
<p>
-n This specifies JMeter is to run in non-gui mode
</p>
<p>
-t [name of JMX file that contains the Test Plan].
</p>
<p>
-l [name of JTL file to log sample results to].
</p>
<p>
-r Run the test in the servers specified by the JMeter property "remote_hosts"
</p>
<p>
-R [list of remote servers] Run the test in the specified remote servers
</p>
<p>
The script also lets you specify the optional firewall/proxy server information:
</p>
<p>
-H [proxy server hostname or ip address]
<br>
</br>

-P [proxy server port]
</p>
<p>
<b>
Example
</b>
: jmeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="server"><strong>2.4.4 Server Mode</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
For 
<a href="remote-test.html">
distributed testing
</a>
, run JMeter in server mode on the remote node(s), and then control the server(s) from the GUI.
You can also use non-GUI mode to run remote tests.
To start the server(s), run jmeter-server/jmeter-server.bat on each server host.
</p>
<p>
The script also lets you specify the optional firewall/proxy server information:
</p>
<p>
-H [proxy server hostname or ip address]
<br>
</br>

-P [proxy server port]
</p>
<p>
<b>
Example
</b>
: jmeter-server -H my.proxy.server -P 8000
</p>
<p>
If you want the server to exit after a single test has been run, then define the JMeter property server.exitaftertest=true.

</p>
<p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -