Commit a594550a authored by jiang feng's avatar jiang feng
Browse files

Merge branch 'branch1' into 'main'

Branch1

See merge request !1
parents a19d8b51 8aa83330
Pipeline #1329 passed with stage
in 33 seconds
// Sample BeanShell Function initialisation 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.
*
*/
// N.B. to enable this file to be used, define the JMeter property:
// beanshell.function.init=BeanShellFunction.bshrc
//print("Initialisation started");
import org.apache.jmeter.util.JMeterUtils;
i = j = k = 0; // for counters
getprop(p){// get a JMeter property
return JMeterUtils.getPropDefault(p,"");
}
getprop(p,d){// get a JMeter property with default
return JMeterUtils.getPropDefault(p,d);
}
setprop(p,v){// set a JMeter property
JMeterUtils.setProperty(p, v);
}
// Define routines to stop the test or the current thread
stopTest(){// Stop the JMeter test
org.apache.jmeter.engine.StandardJMeterEngine.stopEngine();
}
stopThread(){// Stop current JMeter thread
org.apache.jmeter.engine.StandardJMeterEngine.stopThread(Thread.currentThread().getName());
}
// Fix ampersands in a string
// e.g. fixAmps("Something containing & ...")
// or fixAmps(vars.get("VARNAME")) - useful if VARNAME may contain "
String fixAmps(s) {
return s.replaceAll("&","&");
}
// Fix ampersands in a variable
// e.g. fixAmps("VARNAME")
String fixAmpsInVar(String varname) {
return fixAmps(vars.get(varname));
}
//print("Initialisation complete");
// Example BeanShell Listener definitions
/*
* 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.
*
*/
// ThreadListener methods
threadStarted(){
print("threadStarted");
}
threadFinished(){
print("threadFinished");
}
// TestListener methods
testStarted(){
print("testStarted");
}
testEnded(){
print("testEnded");
}
testStarted(String s){
print("testStarted "+s);
}
testEnded(String s){
print("testEnded "+s);
}
\ No newline at end of file
// Sample BeanShell Sampler initialisation file
// To enable, define the JMeter property:
// beanshell.sampler.init=BeanShellSampler.bshrc
/*
* 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.
*
*/
//print("Initialisation started");
import org.apache.jmeter.util.JMeterUtils;
i = j = k = 0; // for counters
getprop(p){// get a JMeter property
return JMeterUtils.getPropDefault(p,"");
}
getprop(p,d){// get a JMeter property with default
return JMeterUtils.getPropDefault(p,d);
}
setprop(p,v){// set a JMeter property
JMeterUtils.setProperty(p, v);
}
// Define routines to stop the test or a thread
stopEngine(){// Stop the JMeter test
org.apache.jmeter.engine.StandardJMeterEngine.stopEngine();
}
stopThread(t){// Stop a JMeter thread
org.apache.jmeter.engine.StandardJMeterEngine.stopThread(t);
}
String getVariables(){ // Create a listing of the thread variables
StringBuffer sb = new StringBuffer(100);
Iterator i = vars.getIterator();
while(i.hasNext())
{
Map.Entry me = i.next();
if(String.class.equals(me.getValue().getClass())){
sb.append(me.toString()).append("\n");
}
}
return sb.toString();
}
// Interruptible interface
interrupt() {
print("Interrupt detected");
}
//print("Initialisation complete");
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
keytool -genkey -keyalg RSA -alias rmi -keystore rmi_keystore.jks -storepass changeit -validity 7 -keysize 2048 %*
echo "Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"
#!/bin/sh
#
# 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.
#
keytool -genkey -keyalg RSA -alias rmi -keystore rmi_keystore.jks -storepass changeit -validity 7 -keysize 2048 "$@"
echo "Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"
<%@ page session="false" contentType="text/html" buffer="8kb" %>
<!--
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.
-->
<html>
<body>
<b>textToTExtract</b>
<ul>
<li>textToTExtract2</li>
</ul>
<p>zadadadzdadd </p>
<u>textToTExtract3</u>
<%
int size = Integer.parseInt(request.getParameter("size"));
for (int i=0;i<size;i++) {
%>
<p>abcdefghijklmno<%=System.currentTimeMillis() %><p>
<%
}
%>
</body>
</html>
\ No newline at end of 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.
# Properties file used to define additional default Apache HttpClient parameters
#
#
# This file is enabled by setting the JMeter property: hc.parameters.file
# entries are of the form:
#
# property=value (for strings)
# property$Type=value (for other types)
#
# where Type can be:
# Integer
# Long
# Boolean
# HttpVersion
#
# N.B. Other types are not yet implemented
#
# Examples:
#http.protocol.version$HttpVersion=1.0
#http.protocol.element-charset=ISO-8859-1
#http.socket.timeout$Integer=10000
#http.protocol.reject-relative-redirect$Boolean=true
# Default value since JMeter 2.11,
# also uncomment hc.parameters.file=hc.parameters to enable this check:
#http.connection.stalecheck$Boolean=false
\ No newline at end of file
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
rem Ask the JMeter client to perform a HeapDump
rem P1 = command port for JMeter instance (defaults to 4445)
java -cp "%~dp0ApacheJMeter.jar" org.apache.jmeter.util.ShutdownClient HeapDump %*
pause
#!/bin/sh
#
# 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.
#
# Ask the JMeter client to perform a HeapDump
# P1 = command port for JMeter instance (defaults to 4445)
DIRNAME="$(dirname "$0")"
java -cp "${DIRNAME}/ApacheJMeter.jar" org.apache.jmeter.util.ShutdownClient HeapDump "$@"
/**
* 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.
*/
/**
* Sample file, you need to edit for your configuration
* see http://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/lab/part6.html#Kerberos_5_Configuration
* see http://docs.oracle.com/javase/7/docs/technotes/guides/security/jgss/tutorials/KerberosReq.html
* see http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html
*/
JMeter {
com.sun.security.auth.module.Krb5LoginModule required
doNotPrompt=false
useKeyTab=false
storeKey=false;
};
\ No newline at end of file
#! /bin/sh
## 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.
## ==============================================
## Environment variables:
## JVM_ARGS - optional java args, e.g. -Dprop=val
##
## e.g.
## JVM_ARGS="-Xms1g -Xmx1g" jmeter etc.
##
## Do not set the variables in this script. Instead put them into a script
## setenv.sh in JMETER_HOME/bin to keep your customizations separate.
##
## JAVA_HOME Must point at your Java Development Kit installation.
## Required to run the with the "debug" argument.
##
## JRE_HOME Must point at your Java Runtime installation.
## Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
## are both empty, JMeter will try to guess JAVA_HOME.
## If JRE_HOME and JAVA_HOME are both set, JAVA_HOME is used.
##
## GC_ALGO (Optional) Java runtime options to specify JVM garbage collection
## algorithm
## Defaults to "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20"
##
## HEAP (Optional) Java runtime options for memory management
## used when JMeter is started.
## Defaults to "-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"
##
## JMETER_HOME (Optional) May point to your JMeter install dir. If empty
## it will be set relativ to this script.
##
## JMETER_LANGUAGE (Optional) Java runtime options to specify used language
## Defaults to "-Duser.language=en -Duser.region=EN"
##
## JMETER_OPTS (Optional) Java runtime options used when JMeter is started.
## Special options for operating systems might be added by JMeter.
##
## ==============================================
# resolve links - $0 may be a softlink (code as used by Tomcat)
# N.B. readlink would be a lot simpler but is not supported on Solaris
PRG="$0"
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
# Only set JMETER_HOME if not already set
[ -z "$JMETER_HOME" ] && JMETER_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
if [ -r "${JMETER_HOME}/bin/setenv.sh" ]; then
. "${JMETER_HOME}/bin/setenv.sh"
fi
# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
if [ "`uname`" = "Darwin" ]; then
#
if [ -x '/usr/libexec/java_home' ] ; then
export JAVA_HOME=`/usr/libexec/java_home`
#
elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"
fi
else
JAVA_PATH=`which java 2>/dev/null`
if [ "x$JAVA_PATH" != "x" ]; then
JAVA_PATH=`dirname "$JAVA_PATH" 2>/dev/null`
JRE_HOME=`dirname "$JAVA_PATH" 2>/dev/null`
fi
if [ "x$JRE_HOME" = "x" ]; then
# XXX: Should we try other locations?
if [ -x /usr/bin/java ]; then
JRE_HOME=/usr
fi
fi
fi
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
echo "At least one of these environment variable is needed to run this program"
exit 1
fi
fi
if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
echo "JAVA_HOME should point to a JDK in order to run in debug mode."
exit 1
fi
if [ -z "$JRE_HOME" ]; then
JRE_HOME="$JAVA_HOME"
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME="$JRE_HOME"
fi
#--add-opens if JAVA 9
JAVA9_OPTS=
# Minimal version to run JMeter
MINIMAL_VERSION=8
# Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
CURRENT_VERSION=`"${JAVA_HOME}/bin/java" -version 2>&1 | awk -F'"' '/version/ {gsub("^1[.]", "", $2); gsub("[^0-9].*$", "", $2); print $2}'`
# Check if Java is present and the minimal version requirement
if [ "$CURRENT_VERSION" -gt "$MINIMAL_VERSION" ]; then
JAVA9_OPTS="--add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED --add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED"
fi
: "${JMETER_OPTS:=""}"
case `uname` in
Darwin*)
# Add Mac-specific properties - should be ignored elsewhere (Bug 47064)
if [ -f ${PRGDIR}/../xdocs/images/jmeter_square.png ]; then
JMETER_OPTS="${JMETER_OPTS} -Xdock:icon=${PRGDIR}/../xdocs/images/jmeter_square.png"
elif [ -f ${PRGDIR}/../docs/images/jmeter_square.png ]; then
JMETER_OPTS="${JMETER_OPTS} -Xdock:icon=${PRGDIR}/../docs/images/jmeter_square.png"
fi
# Note: macOS still shows "java" process name (see https://bugs.openjdk.java.net/browse/JDK-8173753)
# The workaround could be to distribute *.dmg bundle
JMETER_OPTS="${JMETER_OPTS} -Xdock:name=JMeter -Xdock:icon=${PRGDIR}/../docs/images/jmeter_square.png -Dapple.laf.useScreenMenuBar=true -Dapple.eawt.quitStrategy=CLOSE_ALL_WINDOWS"
;;
esac
#
# Original page has disappeared, it is now only available at:
# https://web.archive.org/web/20060614151434/http://www.atg.com/portal/myatg/developer?paf_dm=full&paf_gear_id=1100010&detailArticle=true&id=9606
#
# JMeter objects can generally be grouped into three life-length groups:
#
# - Per-sample objects (results, DOMs,...). An awful lot of those.
# Life length of milliseconds to a few seconds.
#
# - Per-run objects (threads, listener data structures,...). Not that many
# of those unless we use the table or tree listeners on heavy runs.
# Life length of minutes to several hours, from creation to start of next run.
#
# - Per-work-session objects (test plans, GUIs,...).
# Life length: for the life of the JVM.
# This is the base heap size -- you may increase or decrease it to fit your
# system's memory availability:
: "${HEAP:="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"}"
# Set language
# Default to en_EN
: "${JMETER_LANGUAGE:="-Duser.language=en -Duser.region=EN"}"
# Uncomment this to generate GC verbose file with Java prior to 9
# VERBOSE_GC="-verbose:gc -Xloggc:gc_jmeter_%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintAdaptiveSizePolicy -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps"
# Uncomment this to generate GC verbose file with Java 9 and above
# VERBOSE_GC="-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%p.log"
# Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
# see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
# RUN_IN_DOCKER="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
# Finally, some tracing to help in case things go astray:
# You may want to add those settings:
# -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
: "${GC_ALGO:="-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20"}"
# Always dump on OOM (does not cost anything unless triggered)
DUMP="-XX:+HeapDumpOnOutOfMemoryError"
SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
SERVER="-server"
if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
ARGS="$JAVA9_OPTS $SERVER $DUMP $HEAP $VERBOSE_GC $GC_ALGO $SYSTEM_PROPS $JMETER_LANGUAGE $RUN_IN_DOCKER"
else
ARGS=""
fi
"$JAVA_HOME/bin/java" $ARGS $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
rem ============================================
rem Non-GUI version of JMETER.BAT
rem
rem Drop a JMX file on this batch script, and it
rem will run it in non-GUI mode, with a log file
rem formed from the input file name but with the
rem extension .jtl
rem
rem Only the first parameter is used.
rem
rem ============================================
rem Check file is supplied
if a == a%1 goto winNT2
rem Allow special name LAST
if LAST == %1 goto winNT3
rem Check it has extension .jmx
if "%~x1" == ".jmx" goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3
rem Change to script directory
pushd %~dp1
rem use same directory to find jmeter script
call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl" -r %2 %3 %4 %5 %6 %7 %8 %9
popd
:END
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
rem ============================================
rem Non-GUI version of JMETER.BAT
rem
rem Drop a JMX file on this batch script, and it
rem will run it in non-GUI mode, with a log file
rem formed from the input file name but with the
rem extension .jtl
rem
rem Only the first parameter is used.
rem
rem ============================================
rem Check file is supplied
if a == a%1 goto winNT2
rem Allow special name LAST
if LAST == %1 goto winNT3
rem Check it has extension .jmx
if "%~x1" == ".jmx" goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3
rem Change to script directory
pushd %~dp1
rem use same directory to find jmeter script
call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl" %2 %3 %4 %5 %6 %7 %8 %9
popd
:END
#!/bin/sh
## 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.
## To change the RMI/Server port:
##
## SERVER_PORT=1234 jmeter-server
##
DIRNAME=`dirname $0`
# If the client fails with:
# ERROR - jmeter.engine.ClientJMeterEngine: java.rmi.ConnectException: Connection refused to host: 127.0.0.1
# then it may be due to the server host returning 127.0.0.1 as its address
# One way to fix this is to define RMI_HOST_DEF below
#RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx
${DIRNAME}/jmeter ${RMI_HOST_DEF} -Dserver_port=${SERVER_PORT:-1099} -s -j jmeter-server.log "$@"
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
rem ===============================================================
rem Enviroment variables
rem SERVER_PORT (optional) - define the rmiregistry and server port
rem
rem JVM_ARGS - Java flags - these are handled by jmeter.bat
rem
rem ===============================================================
REM Protect environment against changes
setlocal
if exist jmeter-server.bat goto winNT1
echo Changing to JMeter home directory
cd /D %~dp0
:winNT1
if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP
echo Could not find ApacheJmeter_core.jar ...
REM Try to work out JMETER_HOME
echo ... Trying JMETER_HOME=..
set JMETER_HOME=..
if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP
echo ... trying JMETER_HOME=.
set JMETER_HOME=.
if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP
echo Cannot determine JMETER_HOME !
goto exit
:setCP
echo Found ApacheJMeter_core.jar
REM No longer need to create the rmiregistry as it is done by the server
REM set CLASSPATH=%JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar
REM START rmiregistry %SERVER_PORT%
REM
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*
if not "%SERVER_PORT%" == "" goto port
call jmeter -s -j jmeter-server.log %JMETER_CMD_LINE_ARGS%
goto end
:port
call jmeter -Dserver_port=%SERVER_PORT% -s -j jmeter-server.log %JMETER_CMD_LINE_ARGS%
:end
rem No longer needed, as server is started in-process
rem taskkill /F /IM rmiregistry.exe
:exit
@echo off
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
rem ============================================
rem
rem Drop a JMX file on this batch script, and it
rem will load it in the GUI.
rem
rem Only the first parameter is used.
rem
rem ============================================
rem Check file is supplied
if a == a%1 goto winNT2
rem Allow special name LAST
if LAST == %1 goto winNT3
rem Check it has extension .jmx
if "%~x1" == ".jmx" goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3
rem Start in directory with JMX file
pushd %~dp1
rem Prepend the directory in which this script resides in case not on path
call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9
popd
:END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment