Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 11 additions & 52 deletions acmeair-jmeter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Also needed is the json-simple library to jmeter's ext directory.
```text
cd acmeair-jmeter/scripts/
```
Edit the host.csv file to be the appropriate name or address for the WebSphere Liberty server.
The workload can be started using either the command line or JMeter's graphical interface.
To specify the address of the server, specify `-JHOSTNAME=<hostname> -JPORT=<port>` on the JMeter command line to match the address of your WebSphere Liberty server. Alternatively, edit the `user.properties` file, changing `HOSTNAME` and `PORT`, and supply this file to JMeter with `-q user.properties`.

The workload can be executed using either the command line or JMeter's graphical interface.

To run the workload using the command line, some additional steps are needed to configure what will be collected in the output. Edit the %JMETER_DIR%/bin/jmeter.properties file setting the summariser properties to get basic output reporting.

Expand All @@ -57,7 +58,7 @@ summariser.name=summary
summariser.interval=30
summariser.log=true
```
Setting these properties will allow summary statistics to be printed on the console screen, as well as in the specified log file.
Setting these properties will allow summary statistics to be printed on the console screen, as well as in the specified log file. Alternatively, use the provided `user.properties` file which already enables the summarizer.

In addition to the data collected to the log file. JMeter can also collect the sampler result data of individual requests. What data is collected in this JTL file is fully configurable within the jmeter.properties file, and a basic set of data collection is enabled in JMeter by default. Adding too many metrics to be collected can add additional overhead to the workload process.

Expand All @@ -66,7 +67,7 @@ The default format of the JTL file output is csv. if desired, this can be switch
jmeter.save.saveservice.output_format=xml
```

In addition to the standard metrics that are available within JMeter, the AcmeAir.jmx test plan also has some additional metrics available. These custom metrics can be printed in the JTL output file by adding the sample_variables property to the %JMETER_DIR%/bin/user.properties file.
In addition to the standard metrics that are available within JMeter, the AcmeAir.jmx test plan also has some additional metrics available. These custom metrics can be printed in the JTL output file by adding the sample_variables property to the %JMETER_DIR%/bin/user.properties file. This is already present in the provided `user.properties` file.
```text
sample_variables=FLIGHTTOCOUNT,FLIGHTRETCOUNT,ONEWAY
```
Expand Down Expand Up @@ -107,70 +108,28 @@ Alternatively, the workload can also be ran from the command line if desired.

The most common syntax for running the workload from the command line would be:
```text
%JMETER_DIR%/bin/jmeter -n -t AcmeAir.jmx -j AcmeAir1.log -l AcmeAir1.jtl
%JMETER_DIR%/bin/jmeter -n -t AcmeAir.jmx -j AcmeAir1.log -l AcmeAir1.jtl -q user.properties
```
* **-n** This specifies JMeter is to run in non-gui mode
* **-t** The name of the JMeter test plan.
* **-j** The name of the output log file.
* **-l** The name of the output file to collect JMeter sampler results.

* **-q** The name of the JMeter user.properties file.

## Instructions to run the workload for the NodeJS implementation

In order to run the JMeter workload script with the NodeJS implementation of Acme Air, there are a couple of minor changes necessary.

*1*.) Change the CONTEXT_ROOT user defined variable from /acmeair-webapp to an empty value.

```text
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="CONTEXT_ROOT" elementType="Argument">
<stringProp name="Argument.name">CONTEXT_ROOT</stringProp>
<stringProp name="Argument.value">/acmeair-webapp</stringProp>
<stringProp name="Argument.desc">prepended to all http urls</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</Arguments>
```
In the above stanza *Argument.value* should be changed to:
*1*.) Change the CONTEXT_ROOT user defined variable from /acmeair-webapp to an empty value either by passing `-JCONTEXT_ROOT=` on the command line, or in `user.properties`:

```text
<stringProp name="Argument.value"></stringProp>
CONTEXT_ROOT=
```



*2*.) Change the port from 9080 to 3000

```text
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">${WLP_HOSTS}</stringProp>
<stringProp name="HTTPSampler.port">9080</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/acmeair-webapp</stringProp>
<stringProp name="HTTPSampler.concurrentPool">4</stringProp>
</ConfigTestElement>
<hashTree/>
```
The HTTPSampler.port property should be changed to be 3000 (or whichever port the target server is listening on).

```text
<stringProp name="HTTPSampler.port">3000</stringProp>
```


*3*.) When running the jmeter command add a Java systems property to the command line:
*2*.) When running the jmeter command, either add a Java systems property to the command line:

```text
%JMETER_DIR%/bin/jmeter -DusePureIDs=true -n -t AcmeAir.jmx -j AcmeAir1.log -l AcmeAir1.jtl
```



Or use the provided system.properties file by specifying `-S system.properties` on the JMeter command line.
25 changes: 7 additions & 18 deletions acmeair-jmeter/scripts/AcmeAir.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,21 @@
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">30</stringProp>
<stringProp name="ThreadGroup.num_threads">${__P(THREADS, 1)}</stringProp>
<stringProp name="ThreadGroup.ramp_time">${__P(RAMPUP, 30)}</stringProp>
<boolProp name="ThreadGroup.scheduler">true</boolProp>
<stringProp name="ThreadGroup.duration">600</stringProp>
<stringProp name="ThreadGroup.delay">10</stringProp>
<stringProp name="ThreadGroup.duration">${__P(DURATION, 600)}</stringProp>
<stringProp name="ThreadGroup.delay">${__P(DELAY, 10)}</stringProp>
<longProp name="ThreadGroup.start_time">1370979917000</longProp>
<longProp name="ThreadGroup.end_time">1370979917000</longProp>
</ThreadGroup>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
<stringProp name="delimiter">,</stringProp>
<stringProp name="fileEncoding"></stringProp>
<stringProp name="filename">hosts.csv</stringProp>
<boolProp name="quotedData">false</boolProp>
<boolProp name="recycle">true</boolProp>
<stringProp name="shareMode">Current thread</stringProp>
<boolProp name="stopThread">false</boolProp>
<stringProp name="variableNames">WLP_HOSTS</stringProp>
</CSVDataSet>
<hashTree/>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">${WLP_HOSTS}</stringProp>
<stringProp name="HTTPSampler.port">9080</stringProp>
<stringProp name="HTTPSampler.domain">${__P(HOSTNAME, localhost)}</stringProp>
<stringProp name="HTTPSampler.port">${__P(PORT, 9080)}</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
Expand All @@ -71,7 +60,7 @@
<collectionProp name="Arguments.arguments">
<elementProp name="CONTEXT_ROOT" elementType="Argument">
<stringProp name="Argument.name">CONTEXT_ROOT</stringProp>
<stringProp name="Argument.value">/acmeair-webapp</stringProp>
<stringProp name="Argument.value">${__P(CONTEXT_ROOT, /acmeair-webapp)}</stringProp>
<stringProp name="Argument.desc">prepended to all http urls</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
Expand Down
1 change: 0 additions & 1 deletion acmeair-jmeter/scripts/hosts.csv

This file was deleted.

116 changes: 116 additions & 0 deletions acmeair-jmeter/scripts/system.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Sample system.properties file
#
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

# Commons Logging properties
# Used by HttpComponents 4.x, see:
# http://hc.apache.org/httpcomponents-client-4.3.x/logging.html
#
# By default, Commons Logging is configured by JMeter to use the same logging system
# as the main JMeter code; to configure it please see jmeter.properties.
#
# Uncomment to enable debugging of Commons Logging setup; may be useful if
# implementation cannot be instantiated:
#org.apache.commons.logging.diagnostics.dest=STDERR
#
# Uncomment to enable Commons Logging to use standard output
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
#org.apache.commons.logging.simplelog.showdatetime=true
#
# Uncomment the following two lines to generate basic debug logging for HC4.x
#org.apache.commons.logging.simplelog.log.org.apache.http=DEBUG
#org.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR

# Java networking-related properties
#
# For details of Oracle Java network properties, see for example:
# http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html
#
#java.net.preferIPv4Stack=false
#java.net.preferIPv6Addresses=false
#networkaddress.cache.ttl=-1
#networkaddress.cache.negative.ttl=10

#
#
# SSL properties (moved from jmeter.properties)
#
# See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Customization
# for information on the javax.ssl system properties

# Truststore properties (trusted certificates)
#javax.net.ssl.trustStore=/path/to/[jsse]cacerts
#javax.net.ssl.trustStorePassword
#javax.net.ssl.trustStoreProvider
#javax.net.ssl.trustStoreType [default = KeyStore.getDefaultType()]

# Keystore properties (client certificates)
# Location
#javax.net.ssl.keyStore=.keystore
#
#The password to your keystore
#javax.net.ssl.keyStorePassword=changeit
#
#javax.net.ssl.keyStoreProvider
#javax.net.ssl.keyStoreType [default = KeyStore.getDefaultType()]

# SSL debugging:
# See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug
#
# javax.net.debug=help - generates the list below:
#all turn on all debugging
#ssl turn on ssl debugging
#
#The following can be used with ssl:
# record enable per-record tracing
# handshake print each handshake message
# keygen print key generation data
# session print session activity
# defaultctx print default SSL initialization
# sslctx print SSLContext tracing
# sessioncache print session cache tracing
# keymanager print key manager tracing
# trustmanager print trust manager tracing
#
# handshake debugging can be widened with:
# data hex dump of each handshake message
# verbose verbose handshake message printing
#
# record debugging can be widened with:
# plaintext hex dump of record plaintext
#
# Examples:
#javax.net.debug=ssl
#javax.net.debug=sslctx,session,sessioncache
#
#
# We enable the following property to allow headers such as "Host" to be passed through.
# See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996110
sun.net.http.allowRestrictedHeaders=true

#Uncomment for Kerberos authentication and edit the 2 config files to match your domains
#With the following configuration krb5.conf and jaas.conf must be located in bin folder
#You can modify these file paths to use absolute location
#java.security.krb5.conf=krb5.conf
#java.security.auth.login.config=jaas.conf

# Location of keytool application
# This property can be defined if JMeter cannot find the application automatically
# It should not be necessary in most cases.
#keytool.directory=<Java Home Directory>/bin

# Required for Node.js implementation of AcmeAir
usePureIDs=true
89 changes: 89 additions & 0 deletions acmeair-jmeter/scripts/user.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Sample user.properties file
#
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

#---------------------------------------------------------------------------
# Classpath configuration
#---------------------------------------------------------------------------
#
# List of paths (separated by ;) to search for additional JMeter plugin classes,
# for example new GUI elements and samplers.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib/ext directory.
# Do not use this for utility ir plugin dependecy jars.
#search_paths=/app1/lib;/app2/lib

# List of paths that JMeter will search for utility and plugin dependency classes.
# Use your platform path separator to separate multiple paths.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib directory.
# All entries will be added to the class path of the system class loader
# and also to the path of the JMeter internal loader.
# Paths with spaces may cause problems for the JVM
#user.classpath=../classes;../lib;../app1/jar1.jar;../app2/jar2.jar

# List of paths (separated by ;) that JMeter will search for utility
# and plugin dependency classes.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib directory
# or given by the user.classpath property.
# All entries will be added to the path of the JMeter internal loader only.
# For plugin dependencies using plugin_dependency_paths should be preferred over
# user.classpath.
#plugin_dependency_paths=../dependencies/lib;../app1/jar1.jar;../app2/jar2.jar

#---------------------------------------------------------------------------
# Logging configuration
#---------------------------------------------------------------------------
#log_level.jorphan.reflect=DEBUG
# Warning: enabling the next debug line causes javax.net.ssl.SSLException: Received fatal alert: unexpected_message
# for certain sites when used with the default HTTP Sampler
#log_level.jmeter.util.HttpSSLProtocolSocketFactory=DEBUG
#log_level.jmeter.util.JsseSSLManager=DEBUG

# Enable Proxy request debug
#log_level.jmeter.protocol.http.proxy.HttpRequestHdr=DEBUG

#---------------------------------------------------------------------------
# Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode)
#---------------------------------------------------------------------------
#
summariser.name=summary
summariser.interval=30
summariser.log=true
summariser.out=true

#
# AcmeAir sample variables
#
sample_variables=FLIGHTTOCOUNT,FLIGHTRETCOUNT,ONEWAY

#
# Tunables for AcmeAir.jmx
#
HOSTNAME=localhost
PORT=9080
THREADS=1
RAMPUP=30
DURATION=600
DELAY=10
CONTEXT_ROOT=/acmeair-webapp