Difference between revisions of "IT-SDK-JMeter"
Jump to navigation
Jump to search
Samerhijazi (talk | contribs) (→Elemente) |
Samerhijazi (talk | contribs) (→Setting) |
||
| (19 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | =Ref-Mix= | ||
| + | *https://chercher.tech/jmeter/throughput-controller-jmeter | ||
| + | =Ref-JMeter= | ||
| + | *https://jmeter-plugins.org/install/Install/ | ||
| + | *https://jmeter.apache.org/usermanual/functions.html | ||
| + | *https://jmeter.apache.org/usermanual/functions.html#__digest | ||
| + | *https://jmeter.apache.org/usermanual/get-started.html#proxy_server | ||
| + | |||
=Elemente= | =Elemente= | ||
*Transaction controller | *Transaction controller | ||
*Debug Sampler | *Debug Sampler | ||
| + | *Constant Throughput Timer: Is used as a goal-oriented element which helps to achieve the desired throughput (Total Number of Requests). | ||
| + | *Throughput Controller | ||
| + | * | ||
| + | =Proxy= | ||
| + | * https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ | ||
| + | * https://jmeter-plugins.org/wiki/PluginsManagerNetworkConfiguration/ | ||
| + | <pre class="code"> | ||
| + | https.proxy.domain= | ||
| + | https.proxy.port= | ||
| + | https.proxy.user= | ||
| + | https.proxy.password= | ||
| + | --------------------------------- | ||
| + | jmeter -H localhost -P 8888 -u username -a password | ||
| + | --------------------------------- | ||
| + | JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" jmeter\bin\jmeter.bat | ||
| + | </pre> | ||
| + | |||
| + | =Setting= | ||
| + | *JMeter '''Properties''' are global to JMeter and are mostly used to define some of the defaults JMeter uses. | ||
| + | *JMeter '''Variables''' are local to each thread. The values may be the same for each thread, or they may be different. | ||
| + | *----------------- | ||
| + | *vars.get is used to retrieve thread-local variables within a specific thread group or thread. | ||
| + | *props.get is used to retrieve global properties that are accessible throughout the entire JMeter instance. | ||
| + | <pre class="code"> | ||
| + | import org.apache.jmeter.util.JMeterUtils; | ||
| + | . | ||
| + | JMeterUtils.setProperty("NAME_VALUE", vars.get("UserName")); | ||
| + | JMeterUtils.getProperty("NAME_VALUE"); | ||
| + | . | ||
| + | ${__property(NAME_VALUE)} | ||
| + | ${__P(NAME_VALUE)} | ||
| + | -------------------------------------------------------------- | ||
| + | vars.get("NAME_VALUE"); | ||
| + | vars.put("NAME_VALUE", "XXX"); | ||
| + | . | ||
| + | props.get("myVar"); | ||
| + | props.put("myVar", "myValue"); | ||
| + | . | ||
| + | ${NAME_VALUE} | ||
| + | </pre> | ||
| + | |||
| + | =Functions= | ||
| + | <pre class="code"> | ||
| + | import org.apache.jmeter.util.JMeterUtils; | ||
| + | . | ||
| + | JMeterUtils.loadJMeterProperties("path/to/your/jmeter.properties"); | ||
| + | JMeterUtils.saveProperties("path/to/your/jmeter.properties"); | ||
| + | . | ||
| + | JMeterUtils.getProperty("myProperty"); | ||
| + | JMeterUtils.setProperty("myProperty", "myValue"); | ||
| + | . | ||
| + | </pre> | ||
Latest revision as of 10:30, 9 April 2024
Ref-Mix
Ref-JMeter
- https://jmeter-plugins.org/install/Install/
- https://jmeter.apache.org/usermanual/functions.html
- https://jmeter.apache.org/usermanual/functions.html#__digest
- https://jmeter.apache.org/usermanual/get-started.html#proxy_server
Elemente
- Transaction controller
- Debug Sampler
- Constant Throughput Timer: Is used as a goal-oriented element which helps to achieve the desired throughput (Total Number of Requests).
- Throughput Controller
Proxy
- https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/
- https://jmeter-plugins.org/wiki/PluginsManagerNetworkConfiguration/
https.proxy.domain= https.proxy.port= https.proxy.user= https.proxy.password= --------------------------------- jmeter -H localhost -P 8888 -u username -a password --------------------------------- JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" jmeter\bin\jmeter.bat
Setting
- JMeter Properties are global to JMeter and are mostly used to define some of the defaults JMeter uses.
- JMeter Variables are local to each thread. The values may be the same for each thread, or they may be different.
- -----------------
- vars.get is used to retrieve thread-local variables within a specific thread group or thread.
- props.get is used to retrieve global properties that are accessible throughout the entire JMeter instance.
import org.apache.jmeter.util.JMeterUtils;
.
JMeterUtils.setProperty("NAME_VALUE", vars.get("UserName"));
JMeterUtils.getProperty("NAME_VALUE");
.
${__property(NAME_VALUE)}
${__P(NAME_VALUE)}
--------------------------------------------------------------
vars.get("NAME_VALUE");
vars.put("NAME_VALUE", "XXX");
.
props.get("myVar");
props.put("myVar", "myValue");
.
${NAME_VALUE}
Functions
import org.apache.jmeter.util.JMeterUtils;
.
JMeterUtils.loadJMeterProperties("path/to/your/jmeter.properties");
JMeterUtils.saveProperties("path/to/your/jmeter.properties");
.
JMeterUtils.getProperty("myProperty");
JMeterUtils.setProperty("myProperty", "myValue");
.