0
votes

I'm trying to run Gatling for some load testing - however, I have yet to be able to run a simulation (I got the recorder to work, but I can't seem to play what was recorded). When I try running the script using the following command that I found (http://www.alexecollins.com/gatling-in-10-minutes/)

bin\gatling.sh -s basic.ExampleSimulation

It reports the following:

Welcome to Git (version 1.9.2-preview20140411)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
GATLING_HOME is set to /c/psi-test-automation/gatling
C:\psi-test-automation\gatling\gatling-charts-highcharts-2.0.0-M3a\bin\gatling.sh: line 33: java: command not found

I looked in the gatling.sh file, and what's failing is the last line of this:

#!/bin/sh

OLDDIR=`pwd`
BIN_DIR=`dirname $0`
cd ${BIN_DIR}/.. && DEFAULT_GATLING_HOME=`pwd` && cd ${OLDDIR}

GATLING_HOME=${GATLING_HOME:=${DEFAULT_GATLING_HOME}}
GATLING_CONF=${GATLING_CONF:=$GATLING_HOME/conf}

export GATLING_HOME GATLING_CONF

echo "GATLING_HOME is set to ${GATLING_HOME}"

JAVA_OPTS="-server -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx512M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly ${JAVA_OPTS}"

CLASSPATH="$GATLING_HOME/lib/*:$GATLING_CONF:$GATLING_HOME/user-files:${JAVA_CLASSPATH}"

java $JAVA_OPTS -cp $CLASSPATH io.gatling.app.Gatling $@

I was originally using 64 bit Java, but it said the directory it was looking in was Program Files (x86); therefore, I downloaded the 32 bit version (now I have both). Both of the Java bins are in the path. Similarly, I have these set:

JAVA_HOME   =    C:\Program Files (x86)\Java\jre7
JRE_HOME    =    C:\Program Files (x86)\Java\jre7

I have no experience with either Gatling or Scala; still, it's frustrating not being able to get this to work when it's supposedly so easy to learn. The documentation seemed to only show how to record simulations, not how to continue running them after the recording (or maybe I'm blind).

Anybody have any idea what the problem could be?

1
This is a Linux/Unix shell script, and will not work on Windows. Find the shell script for your platform.Tassos Bassoukos
figures... it was pre-installed on my machine so I figured it was compatible.user2869231
I'm not find a 'Windows' version. They all have that script. I downloaded version 2.0.0, which is newer than before; while the script is slightly different, the same error occursuser2869231
The Windows version is the .bat script.SomethingDark
heh thought that was just an installer.... but apparently that works, so thanks. Post an answer so I can mark it as bestuser2869231

1 Answers

0
votes

You're using the .sh file, which is for *NIX-based operating systems. However, since you're running this on a Windows machine, you need to use the .bat file that was included in the bin directory and it will work for you.