Skip to content

Commit

Permalink
forgot a folder
Browse files Browse the repository at this point in the history
  • Loading branch information
othub committed May 5, 2019
1 parent 4e34bb4 commit 16bfa68
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -11,7 +11,6 @@
/target

.metadata
bin/
tmp/
*.tmp
*.bak
Expand Down
3 changes: 3 additions & 0 deletions adocs/04_solution_strategy.adoc
Expand Up @@ -42,6 +42,9 @@ The project is developed using the following :
|cucumber-selenium
|To ensure Behaviour-Driven Development, we'll be using **link:https://cucumber.io[cucumber]** and **link:https://www.seleniumhq.org[Selenium]** which are JavaScript browser automation frameworks.
|Gatling
|To measure the performance of our web application.
|===
.Continuous Integration Platforms
Expand Down
4 changes: 4 additions & 0 deletions docs/documentation.html
Expand Up @@ -808,6 +808,10 @@ <h3 id="_decisions">4.2. Decisions</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">cucumber-selenium</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">To ensure Behaviour-Driven Development, we&#8217;ll be using <strong><a href="https://cucumber.io">cucumber</a></strong> and <strong><a href="https://www.seleniumhq.org">Selenium</a></strong> which are JavaScript browser automation frameworks.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Gatling</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">To measure the performance of our web application.</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
Expand Down
87 changes: 87 additions & 0 deletions performance/gatling/bin/gatling.bat
@@ -0,0 +1,87 @@
@ECHO OFF
@REM
@REM Copyright 2011-2017 GatlingCorp (http://gatling.io)
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM 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

setlocal

set USER_ARGS=%*

rem set GATLING_HOME automatically if possible
set "OLD_DIR=%cd%"
cd ..
set "DEFAULT_GATLING_HOME=%cd%"
cd %OLD_DIR%

rem if gatling home is correctly set
if exist "%GATLING_HOME%\bin\gatling.bat" goto gotHome
rem if gatling home is not correctly set
if not "%GATLING_HOME%" == "" goto badHome
rem if not try current folder
if exist "%OLD_DIR%\bin\gatling.bat" set "GATLING_HOME=%OLD_DIR%" && goto gotHome
rem if not try parent folder
if exist "%DEFAULT_GATLING_HOME%\bin\gatling.bat" set "GATLING_HOME=%DEFAULT_GATLING_HOME%" && goto gotHome
rem else tell user to set GATLING_HOME
goto :noHome

:gotHome

if not defined GATLING_CONF set GATLING_CONF="%GATLING_HOME%"\conf

echo GATLING_HOME is set to "%GATLING_HOME%"

set JAVA_OPTS=-Xmx1G -XX:+UseG1GC -XX:MaxGCPauseMillis=30 -XX:G1HeapRegionSize=16m -XX:InitiatingHeapOccupancyPercent=75 -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false %JAVA_OPTS%

if "%PROCESSOR_ARCHITECTURE%" == "x86" if "%PROCESSOR_ARCHITEW6432%" == "" goto skipServer
set JAVA_OPTS=-server -XX:+OptimizeStringConcat %JAVA_OPTS%

:skipServer
set COMPILER_OPTS=-Xss100M %JAVA_OPTS%
rem Setup classpaths
set COMPILER_CLASSPATH="%GATLING_HOME%"\lib\*;%GATLING_CONF%;
set GATLING_CLASSPATH="%GATLING_HOME%"\lib\*;"%GATLING_HOME%"\user-files;%GATLING_CONF%;

set JAVA=java
if exist "%JAVA_HOME%\bin\java.exe" goto setJavaHome
goto run

:setJavaHome
set JAVA="%JAVA_HOME%\bin\java.exe"

:run
echo JAVA = "%JAVA%"
rem Run the compiler
%JAVA% %COMPILER_OPTS% -cp %COMPILER_CLASSPATH% io.gatling.compiler.ZincCompiler %USER_ARGS% 2>NUL
rem Run Gatling
%JAVA% %JAVA_OPTS% -cp %GATLING_CLASSPATH% io.gatling.app.Gatling %USER_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
rem The above line will forward any potential exit codes from Java if Gatling failed

goto exit

:badHome
echo The GATLING_HOME environment variable points to the wrong directory.
echo Please set it to the correct folder and try to launch Gatling again.
goto exit

:noHome
echo GATLING_HOME environment variable is not set and could not be guessed automatically.
echo Please set GATLING_HOME and try to launch Gatling again.
goto exit

:exit
if not defined NO_PAUSE pause
endlocal
exit /b 0
54 changes: 54 additions & 0 deletions performance/gatling/bin/gatling.sh
@@ -0,0 +1,54 @@
#!/bin/sh
#
# Copyright 2011-2017 GatlingCorp (http://gatling.io)
#
# Licensed 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.
#
if [ -n "$JAVA_HOME" ]; then
JAVA="$JAVA_HOME"/bin/java
else
JAVA=java
fi

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}"

DEFAULT_JAVA_OPTS="-server"
DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -Xmx1G -XX:+HeapDumpOnOutOfMemoryError"
DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -XX:+UseG1GC -XX:MaxGCPauseMillis=30 -XX:G1HeapRegionSize=16m -XX:InitiatingHeapOccupancyPercent=75 -XX:+ParallelRefProcEnabled"
DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -XX:+PerfDisableSharedMem -XX:+AggressiveOpts -XX:+OptimizeStringConcat"
DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false"
COMPILER_OPTS="-Xss100M $DEFAULT_JAVA_OPTS $JAVA_OPTS"

# Setup classpaths
COMPILER_CLASSPATH="$GATLING_HOME/lib/*:$GATLING_CONF:"
GATLING_CLASSPATH="$GATLING_HOME/lib/*:$GATLING_HOME/user-files:$GATLING_CONF:"


# Use the extra compiler options flag only if they are provided
if [ -n "$EXTRA_SCALAC_OPTIONS" ]; then
EXTRA_COMPILER_OPTIONS="-eso $EXTRA_SCALAC_OPTIONS"
fi

# Run the compiler
"$JAVA" $COMPILER_OPTS -cp "$COMPILER_CLASSPATH" io.gatling.compiler.ZincCompiler $EXTRA_COMPILER_OPTIONS "$@" 2> /dev/null
# Run Gatling
"$JAVA" $DEFAULT_JAVA_OPTS $JAVA_OPTS -cp "$GATLING_CLASSPATH" io.gatling.app.Gatling "$@"
74 changes: 74 additions & 0 deletions performance/gatling/bin/recorder.bat
@@ -0,0 +1,74 @@
@ECHO OFF
@REM
@REM Copyright 2011-2016 GatlingCorp (http://gatling.io)
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM 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

setlocal

rem set GATLING_HOME automatically if possible
set "OLD_DIR=%cd%"
cd ..
set "DEFAULT_GATLING_HOME=%cd%"
cd %OLD_DIR%

rem if gatling home is correctly set
if exist "%GATLING_HOME%\bin\gatling.bat" goto gotHome
rem if gatling home is not correctly set
if not "%GATLING_HOME%" == "" goto badHome
rem if not try current folder
if exist "%OLD_DIR%\bin\gatling.bat" set "GATLING_HOME=%OLD_DIR%" && goto gotHome
rem if not try parent folder
if exist "%DEFAULT_GATLING_HOME%\bin\gatling.bat" set "GATLING_HOME=%DEFAULT_GATLING_HOME%" && goto gotHome
rem else tell user to set GATLING_HOME
goto :noHome

:gotHome

echo GATLING_HOME is set to "%GATLING_HOME%"

set JAVA_OPTS=-Xms512M -Xmx512M -Xmn100M %JAVA_OPTS%

set CLASSPATH="%GATLING_HOME%"\lib\*;"%GATLING_HOME%"\conf;%JAVA_CLASSPATH%
set COMMAND=-cp %CLASSPATH% io.gatling.recorder.GatlingRecorder

set JAVA=java
if exist "%JAVA_HOME%\bin\java.exe" goto setJavaHome
goto run

:setJavaHome
set JAVA="%JAVA_HOME%\bin\java.exe"

:run
echo JAVA = "%JAVA%"

%JAVA% %JAVA_OPTS% %COMMAND% %1 %2 %3 %4 %5 %6 %7 %8 %9

goto exit


:badHome
echo The GATLING_HOME environnement variable points to the wrong directory.
echo Please set it to the correct folder and try to launch Gatling again.
goto exit

:noHome
echo GATLING_HOME environnement variable is not set and could not be guessed automatically.
echo Please set GATLING_HOME and try to launch Gatling again.
goto exit

:exit
pause
endlocal
exit /b 0
38 changes: 38 additions & 0 deletions performance/gatling/bin/recorder.sh
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Copyright 2011-2016 GatlingCorp (http://gatling.io)
#
# Licensed 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.
#
if [ -n "$JAVA_HOME" ]; then
JAVA="$JAVA_HOME"/bin/java
else
JAVA=java
fi

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="${JAVA_OPTS} -Xms512M -Xmx512M -Xmn100M"

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

"$JAVA" $JAVA_OPTS -cp "$CLASSPATH" io.gatling.recorder.GatlingRecorder "$@"

0 comments on commit 16bfa68

Please sign in to comment.