You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by mi...@apache.org on 2015/07/04 20:04:18 UTC
svn commit: r1689187 [32/32] - in /jmeter/branches/HC4: ./ bin/
bin/templates/ bin/testfiles/ docs/ docs/css/ docs/images/screenshots/
docs/images/screenshots/assertion/ docs/images/screenshots/changes/2.13/
docs/usermanual/ lib/ licenses/bin/ res/mave...
Modified: jmeter/branches/HC4/xdocs/usermanual/regular_expressions.xml
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/xdocs/usermanual/regular_expressions.xml?rev=1689187&r1=1689186&r2=1689187&view=diff
==============================================================================
--- jmeter/branches/HC4/xdocs/usermanual/regular_expressions.xml (original)
+++ jmeter/branches/HC4/xdocs/usermanual/regular_expressions.xml Sat Jul 4 18:04:12 2015
@@ -17,7 +17,7 @@
-->
<!DOCTYPE document
[
-<!ENTITY sect-num '20'>
+<!ENTITY sect-num '21'>
]>
<document prev="functions.html" next="hints_and_tips.html" id="$Id$">
@@ -30,10 +30,10 @@
<section name="§-num;. Regular Expressions" anchor="regex">
<subsection name="§-num;.1 Overview" anchor="overview">
<p>
-JMeter includes the pattern matching software <a href="http://jakarta.apache.org/oro/">Apache Jakarta ORO</a>
+JMeter includes the pattern matching software <a href="http://attic.apache.org/projects/jakarta-oro.html">Apache Jakarta ORO</a>
<br/>
There is some documentation for this on the Jakarta web-site, for example
-<a href="http://jakarta.apache.org/oro/api/org/apache/oro/text/regex/package-summary.html">
+<a href="http://archimedes.fas.harvard.edu/scrapbook/jakarta-oro-2.0.6/docs/api/org/apache/oro/text/regex/package-summary.html">
a summary of the pattern matching characters</a>
</p>
<p>
@@ -42,34 +42,36 @@ There is also documentation on an older
</p>
<p>
The pattern matching is very similar to the pattern matching in Perl.
-A full installation of Perl will include plenty of documentation on regular expressions - look for perlrequick, perlretut, perlre, perlreref.
+A full installation of Perl will include plenty of documentation on regular expressions - look for <code>perlrequick</code>,
+<code>perlretut</code>, <code>perlre</code> and <code>perlreref</code>.
</p>
<p>
-It is worth stressing the difference between "contains" and "matches", as used on the Response Assertion test element:
+It is worth stressing the difference between "<em>contains</em>" and "<em>matches</em>", as used on the Response Assertion test element:
</p>
-<ul>
-<li>
-"contains" means that the regular expression matched at least some part of the target,
-so 'alphabet' "contains" 'ph.b.' because the regular expression matches the substring 'phabe'.
-</li>
-<li>
-"matches" means that the regular expression matched the whole target.
-So 'alphabet' is "matched" by 'al.*t'.
-</li>
-</ul>
-<p>In this case, it is equivalent to wrapping the regular expression in ^ and $, viz '^al.*t$'.
+<dl>
+<dt>"<em>contains</em>"</dt><dd> means that the regular expression matched at least some part of the target,
+so '<code>alphabet</code>' "<em>contains</em>" '<code>ph.b.</code>' because the regular expression matches the substring '<code>phabe</code>'.
+</dd>
+<dt>
+"<em>matches</em>"</dt><dd> means that the regular expression matched the whole target.
+So '<code>alphabet</code>' is "<em>matched</em>" by '<code>al.*t</code>'.
+</dd>
+</dl>
+<p>In this case, it is equivalent to wrapping the regular expression in <code>^</code> and <code>$</code>, viz '<code>^al.*t$</code>'.
</p>
<p>However, this is not always the case.
-For example, the regular expression 'alp|.lp.*' is "contained" in 'alphabet', but does not match 'alphabet'.
-</p>
-<p>Why? Because when the pattern matcher finds the sequence 'alp' in 'alphabet', it stops trying any other combinations - and 'alp' is not the same as 'alphabet', as it does not include 'habet'.
+For example, the regular expression '<code>alp|.lp.*</code>' is "<em>contained</em>" in '<code>alphabet</code>',
+but does not "<em>match</em>" '<code>alphabet</code>'.
</p>
-<p>
-Note: unlike Perl, there is no need to (i.e. do not) enclose the regular expression in //.
+<p>Why? Because when the pattern matcher finds the sequence '<code>alp</code>' in '<code>alphabet</code>', it stops trying any other
+combinations - and '<code>alp</code>' is not the same as '<code>alphabet</code>', as it does not include '<code>habet</code>'.
</p>
+<note>
+Unlike Perl, there is no need to (i.e. do not) enclose the regular expression in <code>//</code>.
+</note>
<p>
-So how does one use the modifiers ismx etc if there is no trailing /?
-The solution is to use <i>extended regular expressions</i>, i.e. /abc/i becomes (?i)abc.
+So how does one use the modifiers <code>ismx</code> etc. if there is no trailing <code>/</code>?
+The solution is to use <i>extended regular expressions</i>, i.e. <code>/abc/i</code> becomes <code>(?i)abc</code>.
See also <a href="#placement">Placement of modifiers</a> below.
</p>
</subsection>
@@ -88,14 +90,14 @@ A suitable regular expression would be:
<p>
The special characters above are:
</p>
-<ul>
-<li>( and ) - these enclose the portion of the match string to be returned</li>
-<li>. - match any character</li>
-<li>+ - one or more times</li>
-<li>? - don't be greedy, i.e. stop when first match succeeds</li>
-</ul>
+<dl>
+<dt><code>(</code> and <code>)</code></dt><dd>these enclose the portion of the match string to be returned</dd>
+<dt><code>.</code></dt><dd>match any character</dd>
+<dt><code>+</code></dt><dd>one or more times</dd>
+<dt><code>?</code></dt><dd>don't be greedy, i.e. stop when first match succeeds</dd>
+</dl>
<p>
-Note: without the ?, the .+ would continue past the first <code>"></code>
+Note: without the <code>?</code>, the <code>.+</code> would continue past the first <code>"></code>
until it found the last possible <code>"></code> - which is probably not what was intended.
</p>
<p>
@@ -103,7 +105,7 @@ Note: although the above expression work
<br/>
<code>name="file" value="([^"]+)"></code>
where<br></br>
-[^"] - means match anything except "<br></br>
+<code>[^"]</code> - means match anything except <code>"</code><br></br>
In this case, the matching engine can stop looking as soon as it sees the first <code>"</code>,
whereas in the previous case the engine has to check that it has found <code>"></code> rather than say <code>" ></code>.
</p>
@@ -113,11 +115,11 @@ Suppose you want to match the following
<code>name="file.name" value="readme.txt"</code>
and you want to extract both <code>file.name</code> and <code>readme.txt</code>.
<br/>
-A suitable reqular expression would be:
+A suitable regular expression would be:
<br/>
<code>name="([^"]+)" value="([^"]+)"</code>
<br/>
-This would create 2 groups, which could be used in the JMeter Regular Expression Extractor template as $1$ and $2$.
+This would create 2 groups, which could be used in the JMeter Regular Expression Extractor template as <code>$1$</code> and <code>$2$</code>.
</p>
<p>
The JMeter Regex Extractor saves the values of the groups in additional variables.
@@ -126,21 +128,21 @@ The JMeter Regex Extractor saves the val
For example, assume:
</p>
<ul>
-<li>Reference Name: MYREF</li>
-<li>Regex: name="(.+?)" value="(.+?)"</li>
-<li>Template: $1$$2$</li>
+<li>Reference Name: <code>MYREF</code></li>
+<li>Regex: <code>name="(.+?)" value="(.+?)"</code></li>
+<li>Template: <code>$1$$2$</code></li>
</ul>
-<note>Do not enclose the regular expression in / /</note>
+<note>Do not enclose the regular expression in <code>/ /</code></note>
<p>
The following variables would be set:
</p>
-<ul>
-<li>MYREF: file.namereadme.txt</li>
-<li>MYREF_g0: name="file.name" value="readme.txt"</li>
-<li>MYREF_g1: file.name</li>
-<li>MYREF_g2: readme.txt</li>
-</ul>
-These variables can be referred to later on in the JMeter test plan, as ${MYREF}, ${MYREF_g1} etc
+<dl>
+<dt><code>MYREF</code></dt><dd><code>file.namereadme.txt</code></dd>
+<dt><code>MYREF_g0</code></dt><dd><code>name="file.name" value="readme.txt"</code></dd>
+<dt><code>MYREF_g1</code></dt><dd><code>file.name</code></dd>
+<dt><code>MYREF_g2</code></dt><dd><code>readme.txt</code></dd>
+</dl>
+These variables can be referred to later on in the JMeter test plan, as <code>${MYREF}</code>, <code>${MYREF_g1}</code> etc.
</p>
</subsection>
<subsection name="§-num;.3 Line mode" anchor="line_mode">
@@ -151,60 +153,63 @@ they can be specified independently.
</p>
<h3>Single-line mode</h3>
<p>
-Single-line mode only affects how the '.' meta-character is interpreted.
+Single-line mode only affects how the '<code>.</code>' meta-character is interpreted.
</p>
<p>
-Default behaviour is that '.' matches any character except newline.
-In single-line mode, '.' also matches newline.
+Default behaviour is that '<code>.</code>' matches any character except newline.
+In single-line mode, '<code>.</code>' also matches newline.
</p>
<h3>Multi-line mode</h3>
<p>
-Multi-line mode only affects how the meta-characters '^' and '$' are interpreted.
+Multi-line mode only affects how the meta-characters '<code>^</code>' and '<code>$</code>' are interpreted.
</p>
<p>
-Default behaviour is that '^' and '$' only match at the very beginning and end of the string.
-When Multi-line mode is used, the '^' metacharacter matches at the beginning of every line,
-and the '$' metacharacter matches at the end of every line.</p>
+Default behaviour is that '<code>^</code>' and '<code>$</code>' only match at the very beginning and end of the string.
+When Multi-line mode is used, the '<code>^</code>' metacharacter matches at the beginning of every line,
+and the '<code>$</code>' metacharacter matches at the end of every line.</p>
</subsection>
<subsection name="§-num;.4 Meta characters" anchor="meta_chars">
<p>
Regular expressions use certain characters as meta characters - these characters have a special meaning to the RE engine.
-Such characters must be escaped by preceeding them with \ (backslash) in order to treat them as ordinary characters.
+Such characters must be escaped by preceding them with <code>\</code> (backslash) in order to treat them as ordinary characters.
Here is a list of the meta characters and their meaning (please check the ORO documentation if in doubt).
</p>
-<ul>
-<li>( ) - grouping</li>
-<li>[ ] - character classes</li>
-<li>{ } - repetition</li>
-<li>* + ? - repetition</li>
-<li>. - wild-card character</li>
-<li>\ - escape character</li>
-<li>| - alternatives</li>
-<li>^ $ - start and end of string or line</li>
-</ul>
+<dl>
+<dt><code>(</code> and <code>)</code></dt><dd>grouping</dd>
+<dt><code>[</code> and <code>]</code></dt><dd>character classes</dd>
+<dt><code>{</code> and <code>}</code></dt><dd>repetition</dd>
+<dt><code>*</code>, <code>+</code> and <code>?</code></dt><dd>repetition</dd>
+<dt><code>.</code></dt><dd>wild-card character</dd>
+<dt><code>\</code></dt><dd>escape character</dd>
+<dt><code>|</code></dt><dd>alternatives</dd>
+<dt><code>^</code> and <code>$</code></dt><dd>start and end of string or line</dd>
+</dl>
<note>
-<p>Please note that ORO does not support the \Q and \E meta-characters.
+Please note that ORO does not support the <code>\Q</code> and <code>\E</code> meta-characters.
[In other RE engines, these can be used to quote a portion of an RE so that the meta-characters stand for themselves.]
You can use function to do the equivalent, see <a href="functions.html#__escapeOroRegexpChars">${__escapeOroRegexpChars(valueToEscape)}</a>.
-</p>
</note>
<p>
The following Perl5 extended regular expressions are supported by ORO.
<dl>
-<dt>(?#text)</dt>
+<dt><code>(?#text)</code></dt>
<dd>An embedded comment causing text to be ignored.</dd>
-<dt>(?:regexp)</dt>
-<dd>Groups things like "()" but doesn't cause the group match to be saved.</dd>
-<dt>(?=regexp)</dt>
-<dd>A zero-width positive lookahead assertion. For example, \w+(?=\s) matches a word followed by whitespace, without including whitespace in the MatchResult.</dd>
-<dt>(?!regexp)</dt>
-<dd>A zero-width negative lookahead assertion. For example foo(?!bar) matches any occurrence of "foo" that isn't followed by "bar". Remember that this is a zero-width assertion, which means that a(?!b)d will match ad because a is followed by a character that is not b (the d) and a d follows the zero-width assertion.</dd>
-<dt>(?imsx)</dt>
-<dd>One or more embedded pattern-match modifiers. i enables case insensitivity, m enables multiline treatment of the input, s enables single line treatment of the input, and x enables extended whitespace comments.</dd>
+<dt><code>(?:regexp)</code></dt>
+<dd>Groups things like "<code>()</code>" but doesn't cause the group match to be saved.</dd>
+<dt><code>(?=regexp)</code></dt>
+<dd>A zero-width positive lookahead assertion. For example, <code>\w+(?=\s)</code> matches a word followed by whitespace, without including whitespace in the MatchResult.</dd>
+<dt><code>(?!regexp)</code></dt>
+<dd>A zero-width negative lookahead assertion. For example <code>foo(?!bar)</code> matches any occurrence of "<code>foo</code>" that
+isn't followed by "<code>bar</code>". Remember that this is a zero-width assertion, which means that <code>a(?!b)d</code> will
+match <code>ad</code> because <code>a</code> is followed by a character that is not <code>b</code> (the <code>d</code>) and a <code>d</code>
+follows the zero-width assertion.</dd>
+<dt><code>(?imsx)</code></dt>
+<dd>One or more embedded pattern-match modifiers. <code>i</code> enables case insensitivity, <code>m</code> enables multiline treatment
+of the input, <code>s</code> enables single line treatment of the input, and <code>x</code> enables extended whitespace comments.</dd>
</dl>
<b>Note that <code>(?<=regexp)</code> - lookbehind - is not supported.</b>
</p>
@@ -218,15 +223,15 @@ Modifiers can be placed anywhere in the
However they would have no effect there anyway.]
</p>
<p>
-The single-line (?s) and multi-line (?m) modifiers are normally placed at the start of the regex.
+The single-line <code>(?s)</code> and multi-line <code>(?m)</code> modifiers are normally placed at the start of the regex.
</p>
<p>
-The ignore-case modifier (?i) may be usefully applied to just part of a regex,
-for example:
-<pre>
+The ignore-case modifier <code>(?i)</code> may be usefully applied to just part of a regex,
+for example:</p>
+<source>
Match ExAct case or (?i)ArBiTrARY(?-i) case
-</pre>
-</p>
+</source>
+would match <code>Match ExAct case or arbitrary case</code> as well as <code>Match ExAct case or ARBitrary case</code>, but not <code>Match exact case or ArBiTrARY case</code>.
</subsection>
</section>
@@ -236,7 +241,7 @@ Since JMeter 2.4, the listener <a href="
include a RegExp Tester to test regular expressions directly on sampler response data.
</p>
<p>
-There is a <a href="http://jakarta.apache.org/oro/demo.html">demo</a> applet for Apache JMeter ORO.
+There is a <a href="http://www.regexplanet.com/advanced/java/index.html">Website</a> to test Java Regular expressions.
</p>
<p>
Another approach is to use a simple test plan to test the regular expressions.
Modified: jmeter/branches/HC4/xdocs/usermanual/remote-test.xml
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/xdocs/usermanual/remote-test.xml?rev=1689187&r1=1689186&r2=1689187&view=diff
==============================================================================
--- jmeter/branches/HC4/xdocs/usermanual/remote-test.xml (original)
+++ jmeter/branches/HC4/xdocs/usermanual/remote-test.xml Sat Jul 4 18:04:12 2015
@@ -20,7 +20,7 @@
<!ENTITY sect-num '15'>
]>
-<document prev="listeners.html" next="best-practices.html" id="$Id$">
+<document prev="listeners.html" next="realtime-results.html" id="$Id$">
<properties>
<title>User's Manual: Remote (Distributed) Testing</title>
@@ -31,47 +31,50 @@
<section name="§-num;. Remote Testing">
<p>In the event that your JMeter client machine is unable, performance-wise, to simulate
-enough users to stress your server, an option exists to control multiple, remote JMeter
-engines from a single JMeter GUI client. By running JMeter remotely, you can replicate
+enough users to stress your server or is limited at network level, an option exists to control multiple, remote JMeter
+engines from a single JMeter client. By running JMeter remotely, you can replicate
a test across many low-end computers and thus simulate a larger load on the server. One
-instance of the JMeter GUI client can control any number of remote JMeter instances, and collect
+instance of the JMeter client can control any number of remote JMeter instances, and collect
all the data from them. This offers the following features:
-
<ul>
<li>Saving of test samples to the local machine </li>
-<li>Managment of multiple JMeterEngines from a single machine </li>
+<li>Management of multiple JMeterEngines from a single machine </li>
<li>No need to copy the test plan to each server - the client sends it to all the servers</li>
</ul>
</p>
<note>
Note: The same test plan is run by all the servers.
JMeter does not distribute the load between servers, each runs the full test plan.
+So if you set 1000 Threads and have 6 JMeter server, you end up injecting 6000 Threads.
</note>
<p>
However, remote mode does use more resources than running the same number of non-GUI tests independently.
If many server instances are used, the client JMeter can become overloaded, as can the client network connection.
+This has been improved by switching to Stripped modes (see below) but you should always check that your client is not overloaded.
</p>
<p>Note that while you can execute the JMeterEngine on your application
server, you need to be mindful of the fact that this will be adding processing
overhead on the application server and thus your testing results will be
somewhat tainted. The recommended approach is to have one or more machines on
the same Ethernet segment as your application server that you configure to run
-the JMeter Engine. This will minimise the impact of the network on the test
+the JMeter Engine. This will minimize the impact of the network on the test
results without impacting the performance of the application server
itself.
</p>
<p><b>Step 0: Configure the nodes</b></p>
<p>
-Make sure that all the nodes (client and servers) are running exactly the same version of JMeter.
-As far as possible, also use the same version of Java on all systems.
-Using different versions of Java may work - but is best avoided.
+Make sure that all the nodes (client and servers) :
+<ul>
+ <li>are running exactly the same version of JMeter.</li>
+ <li>are using the same version of Java on all systems. Using different versions of Java may work but is discouraged.</li>
+</ul>
</p>
<p>
-If the test uses any data files, note that these are not sent across by the client so
-make sure that these are available in the appropriate directory on each server.
-If necessary you can define different values for properties by editting the user.properties or system.properties
+If the test uses any data files, <b>note that these are not sent across by the client so
+make sure that these are available in the appropriate directory on each server</b>.
+If necessary you can define different values for properties by editing the <code>user.properties</code> or <code>system.properties</code>
files on each server. These properties will be picked up when the server is started and may be
used in the test plan to affect its behaviour (e.g. connecting to a different remote server).
Alternatively use different content in any datafiles used by the test
@@ -79,146 +82,158 @@ Alternatively use different content in a
</p>
<p><b>Step 1: Start the servers </b></p>
-<p>To run JMeter in remote node, start the JMeter server component on all machines you wish to run on by running the <b>JMETER_HOME/bin/jmeter-server</b> (unix) or <b>JMETER_HOME/bin/jmeter-server.bat</b> (windows) script.</p>
+<p>To run JMeter in remote node, start the JMeter server component on all machines you wish to run on by running
+the <code>JMETER_HOME/bin/jmeter-server</code> (unix) or <code>JMETER_HOME/bin/jmeter-server.bat</code> (windows) script.</p>
<p>Note that there can only be one JMeter server on each node unless different RMI ports are used.</p>
<p>Since JMeter 2.3.1, the JMeter server application starts the RMI registry itself;
there is no need to start RMI registry separately.
-To revert to the previous behaviour, define the JMeter property server.rmi.create=false on the server host systems.
+To revert to the previous behaviour, define the JMeter property <source>server.rmi.create=false</source> on the server host systems.
</p>
<p>
By default, RMI uses a dynamic port for the JMeter server engine. This can cause problems for firewalls,
-so versions of JMeter after 2.3.2 will check for the JMeter property <b>server.rmi.localport</b>.
+so with versions of JMeter after 2.3.2 you can define the JMeter property <code>server.rmi.localport</code>
+to control this port number.
If this is non-zero, it will be used as the local port number for the server engine.
</p>
<p><b>Step 2: Add the server IP to your client's Properties File</b></p>
-<p>Edit the properties file <i>on the controlling JMeter machine</i>. In /bin/jmeter.properties, find the property named, "remote_hosts", and
+<p>Edit the properties file <i>on the controlling JMeter machine</i>. In <code>JMETER_HOME/bin/jmeter.properties</code>,
+find the property named, "<code>remote_hosts</code>", and
add the value of your running JMeter server's IP address. Multiple such servers can be added, comma-delimited.</p>
-<p>Note that you can use the -R <a href="get-started.html#override">command line option</a>
-instead to specify the remote host(s) to use. This has the same effect as using -r and -Jremote_hosts={serverlist}.
- E.g. jmeter -Rhost1,127.0.0.1,host2</p>
-<p>If you define the JMeter property server.exitaftertest=true, then the server will exit after it runs a single test.
-See also the -X flag (described below)
-</p>
-<p><b>Step 3a: Start the JMeter Client from a GUI client</b></p>
-<p>Now you are ready to start the controlling JMeter client. For MS-Windows, start the client with the script "bin/jmeter.bat". For UNIX,
-use the script "bin/jmeter". You will notice that the Run menu contains two new sub-menus: "Remote Start" and "Remote Stop"
+<p>Note that you can use the <code>-R</code> <a href="get-started.html#override">command line option</a>
+instead to specify the remote host(s) to use. This has the same effect as using <code>-r</code> and <code>-Jremote_hosts={serverlist}</code>.
+ E.g. </p><source>jmeter -Rhost1,127.0.0.1,host2</source>
+<p>If you define the JMeter property <code>server.exitaftertest=true</code>, then the server will exit after it runs a single test.
+See also the <code>-X</code> flag (described below)
+</p>
+<p><b>Step 3a: Start the JMeter Client from a GUI client to check configuration</b></p>
+<p>Now you are ready to start the controlling JMeter client. For MS-Windows, start the client with the script "<code>bin/jmeter.bat</code>". For UNIX,
+use the script "<code>bin/jmeter</code>". You will notice that the Run menu contains two new sub-menus: "Remote Start" and "Remote Stop"
(see figure 1). These menus contain the client that you set in the properties file. Use the remote start and stop instead of the
normal JMeter start and stop menu items.</p>
<figure image="remote/run-menu00.gif" width="232" height="156">Figure 1 - Run Menu</figure>
<p><b>Step 3b: Start the JMeter from a non-GUI Client</b></p>
<p>
-As an alternative, you can start the remote server(s) from a non-GUI (command-line) client.
-The command to do this is:
-<pre>
+GUI mode should only be used for debugging, as a better alternative, you should start the test on remote server(s) from a non-GUI (command-line) client.
+The command to do this is:</p>
+<source>
jmeter -n -t script.jmx -r
+</source>
or
+<source>
jmeter -n -t script.jmx -R server1,server2...
-
+</source>
Other flags that may be useful:
--Gproperty=value - define a property in all the servers (may appear more than once)
--Z - Exit remote servers at the end of the test.
-</pre>
-The first example will start whatever servers are defined in the JMeter property remote_hosts;
-the second example will define remote_hosts from the list of servers and then run the remote servers.
+<dl>
+<dh><code>-Gproperty=value</code></dh><dd>define a property in all the servers (may appear more than once)</dd>
+<dh><code>-X</code></dh><dd>Exit remote servers at the end of the test.</dd>
+</dl>
+The first example will start the test on whatever servers are defined in the JMeter property <code>remote_hosts</code>;<br/>
+The second example will define <code>remote_hosts</code> from the list of servers and then start the test on the remote servers.
<br/>
The command-line client will exit when all the remote servers have stopped.
-</p>
<subsection name="§-num;.1 Doing it Manually" anchor="detail_instructions">
-<p>In some cases, the jmeter-server script may not work for you (if you are using an OS platform not anticipated by the JMeter developers). Here is how to start the JMeter servers (step 1 above) with a more manual process:</p>
+<p>In some cases, the jmeter-server script may not work for you (if you are using an OS platform not anticipated by the JMeter developers).
+Here is how to start the JMeter servers (step 1 above) with a more manual process:</p>
<p><b>Step 1a: Start the RMI Registry</b></p>
<p>
Since JMeter 2.3.1, the RMI registry is started by the JMeter server, so this section does not apply in the normal case.
-To revert to the previous behaviour, define the JMeter property server.rmi.create=false on the server host systems
+To revert to the previous behaviour, define the JMeter property <code>server.rmi.create=false</code> on the server host systems
and follow the instructions below.
</p>
<p>JMeter uses Remote Method Invocation (RMI) as the remote communication mechanism. Therefore, you need
-to run the RMI Registry application (which is named, "rmiregistry") that comes with the JDK and is located in the "bin"
-directory. Before running rmiregistry, make sure that the following jars are in your system claspath:
+to run the RMI Registry application (which is named, "<code>rmiregistry</code>") that comes with the JDK and is located in the "<code>bin</code>"
+directory. Before running <code>rmiregistry</code>, make sure that the following jars are in your system classpath:
<ul>
- <li>JMETER_HOME/lib/ext/ApacheJMeter_core.jar</li>
- <li>JMETER_HOME/lib/jorphan.jar</li>
- <li>JMETER_HOME/lib/logkit-1.2.jar</li>
+ <li><code>JMETER_HOME/lib/ext/ApacheJMeter_core.jar</code></li>
+ <li><code>JMETER_HOME/lib/jorphan.jar</code></li>
+ <li><code>JMETER_HOME/lib/logkit-2.0.jar</code></li>
</ul>
The
-rmiregistry application needs access to certain JMeter classes. Run rmiregistry with no parameters. By default the
-application listens to port 1099.</p>
+rmiregistry application needs access to certain JMeter classes. Run <code>rmiregistry</code> with no parameters. By default the
+application listens to port <code>1099</code>.</p>
<p><b>Step 1b: Start the JMeter Server</b></p>
-<p>Once the RMI Registry application is running, start the JMeter Server.
-Use the "-s" option with the jmeter startup script ("jmeter -s").</p>
+<p>Once the RMI Registry application is running, start the JMeter Server.
+Use the "<code>-s</code>" option with the jmeter startup script ("<code>jmeter -s</code>").</p>
<p>Steps 2 and 3 remain the same.</p>
</subsection>
<subsection name="§-num;.2 Tips" anchor="tips">
<p>
-JMeter/RMI requires a connection from the client to the server. This will use the port you chose, default 1099.<br/>
+JMeter/RMI requires a connection from the client to the server. This will use the port you chose, default <code>1099</code>.<br/>
JMeter/RMI also requires a reverse connection in order to return sample results from the server to the client.<br/>
This will use a high-numbered port. <br/>
-This port can be controlled by jmeter property called client.rmi.localport in jmeter.properties.<br/>
+This port can be controlled by jmeter property called <code>client.rmi.localport</code> in <code>jmeter.properties</code>.<br/>
If there are any firewalls or other network filters between JMeter client and server,
you will need to make sure that they are set up to allow the connections through.
If necessary, use monitoring software to show what traffic is being generated.
</p>
-<p>If you're running Suse Linux, these tips may help. The default installation may enable the firewall. In that case, remote testing will not work properly. The following tips were contributed by Sergey Ten.</p>
+<p>If you're running Suse Linux, these tips may help. The default installation may enable the firewall. In that case,
+remote testing will not work properly. The following tips were contributed by Sergey Ten.</p>
<p>If you see connections refused, turn on debugging by passing the following options.</p>
- rmiregistry -J-Dsun.rmi.log.debug=true
- -J-Dsun.rmi.server.exceptionTrace=true
- -J-Dsun.rmi.loader.logLevel=verbose
- -J-Dsun.rmi.dgc.logLevel=verbose
- -J-Dsun.rmi.transport.logLevel=verbose
- -J-Dsun.rmi.transport.tcp.logLevel=verbose
+<source>
+rmiregistry -J-Dsun.rmi.log.debug=true \
+ -J-Dsun.rmi.server.exceptionTrace=true \
+ -J-Dsun.rmi.loader.logLevel=verbose \
+ -J-Dsun.rmi.dgc.logLevel=verbose \
+ -J-Dsun.rmi.transport.logLevel=verbose \
+ -J-Dsun.rmi.transport.tcp.logLevel=verbose \
+</source>
<p>Since JMeter 2.3.1, the RMI registry is started by the server; however the options can still be passed in from the JMeter command line.
-For example: "jmeter -s -Dsun.rmi.loader.logLevel=verbose" (i.e. omit the -J prefixes).
-Alternatively the properties can be defined in the system.properties file.
+For example: "<code>jmeter -s -Dsun.rmi.loader.logLevel=verbose</code>" (i.e. omit the <code>-J</code> prefixes).
+Alternatively the properties can be defined in the <code>system.properties</code> file.
</p>
-<p>The solution to the problem is to remove the loopbacks 127.0.0.1 and 127.0.0.2 from etc/hosts. What happens is jmeter-server can't connect to rmiregistry if 127.0.0.2 loopback is not available. Use the following settings to fix the problem.</p>
+<p>The solution to the problem is to remove the loopbacks <code>127.0.0.1</code> and <code>127.0.0.2</code> from <code>/etc/hosts</code>.
+What happens is <code>jmeter-server</code> can't connect to rmiregistry if <code>127.0.0.2</code> loopback is not available.
+Use the following settings to fix the problem.</p>
<p> Replace</p>
-<ul>
- <li> `dirname $0`/jmeter -s "$@"</li>
-</ul>
+<source>`dirname $0`/jmeter -s "$@"</source>
<p> With</p>
-<ul>
- <li> HOST="-Djava.rmi.server.hostname=[computer_name][computer_domain]</li>
- <li> -Djava.security.policy=`dirname $0`/[policy_file]"</li>
- <li> `dirname $0`/jmeter $HOST -s "$@"</li>
-</ul>
-<p>Also create a policy file and add [computer_name][computer_domain] line to /etc/hosts.</p>
+<source>
+HOST="-Djava.rmi.server.hostname=[computer_name][computer_domain] \
+ -Djava.security.policy=`dirname $0`/[policy_file]" \
+`dirname $0`/jmeter $HOST -s "$@"
+</source>
+<p>Also create a policy file and add <code>[computer_name][computer_domain]</code> line to <code>/etc/hosts</code>.</p>
<p>In order to better support SSH-tunneling of the RMI communication channels used
in remote testing, since JMeter 2.6:</p>
<ul>
-<li>a new property "client.rmi.localport" can be set to control the RMI port used by the RemoteSampleListenerImpl</li>
+<li>a new property "<code>client.rmi.localport</code>" can be set to control the RMI port used by the RemoteSampleListenerImpl</li>
<li>To support tunneling RMI traffic over an SSH tunnel as the remote endpoint using a port on the local machine,
- loopback interface is now allowed to be used if it has been specified directly using the Java System Property "java.rmi.server.hostname" parameter.</li>
+ loopback interface is now allowed to be used if it has been specified directly using the Java System Property
+ "<code>java.rmi.server.hostname</code>" parameter.</li>
</ul>
</subsection>
<subsection name="§-num;.3 Using a different port" anchor="portchange">
-<p>By default, JMeter uses the standard RMI port 1099. It is possible to change this. For this to work successfully, all the following need to agree:</p>
+<p>By default, JMeter uses the standard RMI port <code>1099</code>. It is possible to change this. For this to work successfully,
+all the following need to agree:</p>
<ul>
-<li>On the server, start rmiregistry using the new port number</li>
-<li>On the server, start JMeter with the property server_port defined</li>
-<li>On the client, update the remote_hosts property to include the new remote host:port settings</li>
+<li>On the server, start <code>rmiregistry</code> using the new port number</li>
+<li>On the server, start JMeter with the property <code>server_port</code> defined</li>
+<li>On the client, update the <code>remote_hosts</code> property to include the new remote <code>host:port</code> settings</li>
</ul>
<p>Since Jmeter 2.1.1, the jmeter-server scripts provide support for changing the port.
-For example, assume you want to use port 1664 (perhaps 1099 is already used).</p>
-<pre>
+For example, assume you want to use port <code>1664</code> (perhaps <code>1099</code> is already used).</p>
On Windows (in a DOS box)
+<source>
C:\JMETER> SET SERVER_PORT=1664
C:\JMETER> JMETER-SERVER [other options]
-
+</source>
On Unix:
+<source>
$ SERVER_PORT=1664 jmeter-server [other options]
+</source>
[N.B. use upper case for the environment variable]
-</pre>
<p>
In both cases, the script starts rmiregistry on the specified port,
-and then starts JMeter in server mode, having defined the "server_port" property.
+and then starts JMeter in server mode, having defined the "<code>server_port</code>" property.
</p>
<p>
-The chosen port will be logged in the server jmeter.log file (rmiregistry does not create a log file).
+The chosen port will be logged in the server <code>jmeter.log</code> file (<code>rmiregistry</code> does not create a log file).
</p>
</subsection>
@@ -227,62 +242,86 @@ The chosen port will be logged in the se
Listeners in the test plan send their results back to the client JMeter which writes the results to the specified files
By default, samples are sent back synchronously as they are generated.
This can affect the maximum throughput of the server test; the sample result has to be sent back before the thread can
-continue.
+continue.
There are some JMeter properties that can be set to alter this behaviour.
</p>
-<ul>
-<li>mode - sample sending mode - default is Standard. This should be set on the client node.</li>
- <ul>
- <li>Standard - send samples synchronously as soon as they are generated</li>
- <li>Hold - hold samples in an array until the end of a run. This may use a lot of memory on the server.</li>
- <li>DiskStore - store samples in a disk file (under java.io.temp) until the end of a run.
- The serialised data file is deleted on JVM exit. </li>
- <li>Batch - send saved samples when either the count or time exceeds a threshold,
+<dl>
+<dh><code>mode</code></dh><dd>sample sending mode - default is <code>StrippedBatch</code> since 2.9. This should be set on the client node.
+ <dl>
+ <dh><code>Standard</code></dh><dd>send samples synchronously as soon as they are generated</dd>
+ <dh><code>Hold</code></dh><dd>hold samples in an array until the end of a run. This may use a lot of memory on the server and is discouraged.</dd>
+ <dh><code>DiskStore</code></dh><dd>store samples in a disk file (under <code>java.io.temp</code>) until the end of a run.
+ The serialised data file is deleted on JVM exit.</dd>
+ <dh><code>StrippedDiskStore</code></dh><dd>remove responseData from successful samples, and use DiskStore sender to send them.</dd>
+ <dh><code>Batch</code></dh><dd>send saved samples when either the count (num_sample_threshold) or time (time_threshold) exceeds a threshold,
at which point the samples are sent synchronously.
The thresholds can be configured on the server using the following properties:
- <ul>
- <li>num_sample_threshold - number of samples to accumulate, default 100</li>
- <li>time_threshold - time threshold, default 60000 ms = 60 seconds</li>
- </ul>
- </li>
- See also the Asynch mode, described below.
- <li>Statistical - send a summary sample when either the count or time exceeds a threshold.
+ <dl>
+ <dh><code>num_sample_threshold</code></dh><dd>number of samples to accumulate, default <code>100</code></dd>
+ <dh><code>time_threshold</code></dh><dd>time threshold, default 60000 ms = 60 seconds</dd>
+ </dl>
+
+ See also the Asynch mode, described below.</dd>
+ <dh><code>Statistical</code></dh><dd>send a summary sample when either the count or time exceeds a threshold.
The samples are summarised by thread group name and sample label.
The following fields are accumulated:
- <ul>
- <li>elapsed time</li>
- <li>latency</li>
- <li>bytes</li>
- <li>sample count</li>
- <li>error count</li>
- </ul>
+ <ul>
+ <li><code>elapsed time</code></li>
+ <li><code>latency</code></li>
+ <li><code>bytes</code></li>
+ <li><code>sample count</code></li>
+ <li><code>error count</code></li>
+ </ul>
Other fields that vary between samples are lost.
- </li>
- <li>Stripped - remove responseData from succesful samples</li>
- <li>StrippedBatch - remove responseData from succesful samples, and use Batch sender to send them.</li>
- <li>Asynch - samples are temporarily stored in a local queue. A separate worker thread sends the samples.
+ </dd>
+ <dh><code>Stripped</code></dh><dd>remove responseData from successful samples</dd>
+ <dh><code>StrippedBatch</code></dh><dd>remove responseData from successful samples, and use Batch sender to send them.</dd>
+ <dh><code>Asynch</code></dh><dd>samples are temporarily stored in a local queue. A separate worker thread sends the samples.
This allows the test thread to continue without waiting for the result to be sent back to the client.
However, if samples are being created faster than they can be sent, the queue will eventually fill up,
and the sampler thread will block until some samples can be drained from the queue.
This mode is useful for smoothing out peaks in sample generation.
The queue size can be adjusted by setting the JMeter property
- <b><code>asynch.batch.queue.size</code></b> (default 100) on the server node.
- </li>
- <li>Custom implementation : set the mode parameter to your custom sample sender class name.
- This must implement the interface SampleSender and have a constructor which takes a single
- parameter of type RemoteSampleListener.
- </li>
- </ul>
-</ul>
-<p>The following properties apply to the Batch and Statistical modes:</p>
- <ul>
- <li>num_sample_threshold - number of samples in a batch (default 100)</li>
- <li>time_threshold - number of milliseconds to wait (default 60 seconds)</li>
- </ul>
+ <code>asynch.batch.queue.size</code> (default <code>100</code>) on the server node.
+ </dd>
+ <dh><code>StrippedAsynch</code></dh><dd>remove responseData from successful samples, and use Async sender to send them.</dd>
+ <dh><code>Custom implementation</code></dh><dd>set the mode parameter to your custom sample sender class name.
+ This must implement the interface <code>SampleSender</code> and have a constructor which takes a single
+ parameter of type <code>RemoteSampleListener</code>.
+ </dd>
+ </dl>
+ </dd>
+</dl>
+<note><code>Stripped</code> mode family strips <code>responseData</code> so this means that some Elements that rely
+on the previous <code>responseData</code> being available will not work.<br/>
+This is not really a problem as there is always a more efficient way to implement this feature.
+</note>
+<p>The following properties apply to the <code>Batch</code> and <code>Statistical</code> modes:</p>
+ <dl>
+ <dh><code>num_sample_threshold</code></dh><dd>number of samples in a batch (default <code>100</code>)</dd>
+ <dh><code>time_threshold</code></dh><dd>number of milliseconds to wait (default 60 seconds)</dd>
+ </dl>
</subsection>
-
+<subsection name="§-num;.5 Dealing with nodes that failed starting" anchor="retries">
+ <p>
+ For large-scale tests there is a chance that some part of remote servers will be unavailable or down.
+ For example, when you use automation script to allocate many cloud machines and use them as generators,
+ some of requested machines might fail booting because of cloud's issues.
+ Since JMeter 2.13 there are new properties to control this behaviour.
+ </p>
+ <p>
+ First what you might want is to retry initialization attempts in hope that failed nodes just slightly delayed their boot.
+ To enable retries, you should set <code>client.tries</code> property to total number of connection attempts.
+ By default it does only one attempt. To control retry delay, set the <code>client.retries_delay</code> property
+ to number of milliseconds to sleep between attempts.
+ </p>
+ <p>
+ Finally, you might still want to run the test with those generators that succeeded initialization and skipping failed nodes.
+ To enable that, set the <code>client.continue_on_fail=true</code> property.
+ </p>
+</subsection>
</section>
Modified: jmeter/branches/HC4/xdocs/usermanual/test_plan.xml
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/xdocs/usermanual/test_plan.xml?rev=1689187&r1=1689186&r2=1689187&view=diff
==============================================================================
--- jmeter/branches/HC4/xdocs/usermanual/test_plan.xml (original)
+++ jmeter/branches/HC4/xdocs/usermanual/test_plan.xml Sat Jul 4 18:04:12 2015
@@ -40,7 +40,7 @@ is off by default). </p>
<p>If you are not recording the data to file, this option makes no difference.</p>
<p>You can also use the Configuration button on a listener to decide what fields to save.</p>
-<subsection name="§-num;.1 ThreadGroup" anchor="thread_group">
+<subsection name="§-num;.1 Thread Group" anchor="thread_group">
<p>Thread group elements are the beginning points of any test plan.
All controllers and samplers must be under a thread group.
Other elements, e.g. Listeners, may be placed directly under the test plan,
@@ -192,7 +192,7 @@ two different searches. However, we wan
each search. We could do this by having 4 simple HTTP request elements (load search,
search "A", load search, search "B"). Instead, we use the <complink name="Interleave
Controller"/> which passes on one child request each time through the test. It keeps the
-ordering (ie - it doesn't pass one on at random, but "remembers" its place) of its
+ordering (i.e. it doesn't pass one on at random, but "remembers" its place) of its
child elements. Interleaving 2 child requests may be overkill, but there could easily have
been 8, or 20 child requests.</p>
@@ -291,7 +291,7 @@ you can indicate that the response is to
the whole response.</p>
<p>You can add an assertion to any Sampler. For example, you can
-add an assertion to a HTTP Request that checks for the text, "&lt;/HTML&gt;". JMeter
+add an assertion to a HTTP Request that checks for the text, "<code></HTML></code>". JMeter
will then check that the text is present in the HTTP response. If JMeter cannot find the
text, then it will mark this as a failed request.</p>
@@ -411,7 +411,7 @@ that Controller. In the following test
<p>Another example, this time using Timers:</p>
<figure image="scoping3.png">complex example</figure>
<p>In this example, the requests are named to reflect the order in which they will be executed. Timer #1 will apply to Requests Two, Three, and Four (notice how order is irrelevant for hierarchical elements). Assertion #1 will apply only to Request Three. Timer #2 will affect all the requests.</p>
-<p>Hopefully these examples make it clear how configuration (hierarchical) elements are applied. If you imagine each Request being passed up the tree branches, to its parent, then to its parent's parent, etc, and each time collecting all the configuration elements of that parent, then you will see how it works. </p>
+<p>Hopefully these examples make it clear how configuration (hierarchical) elements are applied. If you imagine each Request being passed up the tree branches, to its parent, then to its parent's parent, etc., and each time collecting all the configuration elements of that parent, then you will see how it works. </p>
<b>
The Configuration elements Header Manager, Cookie Manager and Authorization manager are
treated differently from the Configuration Default elements.