mirror of
https://github.com/corda/corda.git
synced 2024-12-28 00:38:55 +00:00
README and fixes.
This commit is contained in:
parent
e677946453
commit
5c64917f18
@ -56,7 +56,7 @@ task(runSsh, dependsOn: 'classes', type: JavaExec) {
|
|||||||
|
|
||||||
// Run JMeter (by default the UI).
|
// Run JMeter (by default the UI).
|
||||||
// Extra args can be passed by setting jmeterArgs (e.g. -n to run in non-UI mode).
|
// Extra args can be passed by setting jmeterArgs (e.g. -n to run in non-UI mode).
|
||||||
// e.g. .gradlew tools:jmeter:run -PjmeterArgs="['-n']"
|
// e.g. ./gradlew tools:jmeter:run -PjmeterArgs="['-n']"
|
||||||
// ssh tunnels will be built from local host to remote hosts by specifying jmeterHosts
|
// ssh tunnels will be built from local host to remote hosts by specifying jmeterHosts
|
||||||
// e.g. ./gradlew tools:jmeter:run -PjmeterHosts="['perf-notary.corda.r3cev.com', 'perf-node-1.corda.r3cev.com']"
|
// e.g. ./gradlew tools:jmeter:run -PjmeterHosts="['perf-notary.corda.r3cev.com', 'perf-node-1.corda.r3cev.com']"
|
||||||
// Each host is paired with local host ports listed in remote_hosts of jmeter.properties
|
// Each host is paired with local host ports listed in remote_hosts of jmeter.properties
|
||||||
|
48
tools/jmeter/src/main/kotlin/com/r3/corda/jmeter/README.md
Normal file
48
tools/jmeter/src/main/kotlin/com/r3/corda/jmeter/README.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
This module contains gradle tasks to make running the JMeter (http://jmeter.apache.org)
|
||||||
|
load generation tool against Corda nodes much easier and more useful. It does this by
|
||||||
|
providing a simple way to launch JMeter with the actual JMeter install coming
|
||||||
|
from downloaded dependencies, and by providing some Samplers that interact with
|
||||||
|
the Corda node via RPC.
|
||||||
|
|
||||||
|
To run up the JMeter UI, using the jmeter.properties in the resources folder,
|
||||||
|
type the following:
|
||||||
|
|
||||||
|
./gradlew tools:jmeter:run
|
||||||
|
|
||||||
|
You can then open the example script in "Example Flow Properties.jmx" via the File -> Open menu option. You need to
|
||||||
|
configure the host, ports, user name and password in the Java Sampler that correspond to your chosen target Corda node.
|
||||||
|
Simply running from the UI will result in the RPC client running inside the UI JVM.
|
||||||
|
|
||||||
|
If you wish to pass additional arguments to JMeter, you can do this:
|
||||||
|
|
||||||
|
./gradlew tools:jmeter:run -PjmeterArgs="['-n', '-Ljmeter.engine=DEBUG']"
|
||||||
|
|
||||||
|
The intention is to run against a remote Corda node or nodes, hosted on servers rather than desktops. To
|
||||||
|
this end, we leverage the JMeter ability to run remote agents that actually execute the tests, with these
|
||||||
|
reporting results back to the UI (or headless process if you so desire - e.g. for automated benchmarks). This is
|
||||||
|
supplemented with some additional convenience of automatically creating ssh tunnels to the remote nodes
|
||||||
|
(we don't want the JMeter ports open to the internet) in coordination with the jmeter.properties.
|
||||||
|
The remote agents then run close to the nodes, so the latency of RPC calls is minimised.
|
||||||
|
|
||||||
|
A Capsule (http://www.capsule.io) based launchable JAR is created that can be run with the simple command line
|
||||||
|
|
||||||
|
java -jar jmeter-corda-<version>.jar
|
||||||
|
|
||||||
|
Embedded in the JAR is all of the corda code for flows and RPC, as well as the jmeter.propeties. This
|
||||||
|
JAR will also include a properties file based on the hostname in the JMeter configuration,
|
||||||
|
so we allocate different SSH tunneled port numbers this way.
|
||||||
|
|
||||||
|
To launch JMeter with the tunnels automatically created:
|
||||||
|
|
||||||
|
./gradlew tools:jmeter:run -PjmeterHosts="['hostname1', 'hostname2']"
|
||||||
|
|
||||||
|
The list of hostnames should be of at least length one, with a maximum equal to the length of the remote_hosts
|
||||||
|
option in jmeter.properties. We effectively "zip" together the hostnames and that list to build the SSH tunnels.
|
||||||
|
The remote_hosts property helps define the ports (the hosts should always be local) used
|
||||||
|
for each host listed in jmeterHosts. Some additional ports are also opened based on some other
|
||||||
|
parts of the configuration to access the RMI registry and to allow return traffic
|
||||||
|
from remote agents.
|
||||||
|
|
||||||
|
The SSH tunnels can be started independently with:
|
||||||
|
|
||||||
|
./gradlew tools:jmeter:runSsh -PjmeterHosts="['hostname1', 'hostname2']"
|
@ -46,7 +46,7 @@
|
|||||||
</elementProp>
|
</elementProp>
|
||||||
<elementProp name="password" elementType="Argument">
|
<elementProp name="password" elementType="Argument">
|
||||||
<stringProp name="Argument.name">password</stringProp>
|
<stringProp name="Argument.name">password</stringProp>
|
||||||
<stringProp name="Argument.value">corda_is_awesome</stringProp>
|
<stringProp name="Argument.value">Password Here</stringProp>
|
||||||
<stringProp name="Argument.metadata">=</stringProp>
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
</elementProp>
|
</elementProp>
|
||||||
<elementProp name="notaryName" elementType="Argument">
|
<elementProp name="notaryName" elementType="Argument">
|
||||||
|
Loading…
Reference in New Issue
Block a user