Skip to content

Commit

Permalink
jmeter scripts now support the five scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
nmasse-itix committed Jul 23, 2020
1 parent 43745ba commit 6add05c
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 22 deletions.
15 changes: 12 additions & 3 deletions jmeter/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
set -e # Do not continue if jmeter fails

: ${JMETER:=jmeter}
HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"
export HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"
date="$(date +%F-%H-%M-%S)"
JVM_ARGS="-Djmeter.reportgenerator.report_title=Telegram-Token-Performance-Test"
$JMETER -n -t telegram-token.jmx -l "results-$date.csv" -e -o "report-$date"

for scenario in GetHomePage GetAlbum GetMedia GetRawVideo GetRawPhoto; do
echo
echo "================================================================================"
echo "Running scenario $scenario..."
echo "================================================================================"
echo
export JVM_ARGS="-Djmeter.reportgenerator.report_title=$scenario"
$JMETER -n -t telegram-token.jmx -l "results-$date-$scenario.csv" -e -o "report-$date-$scenario" -Jscenario=$scenario
sleep 2
done
184 changes: 165 additions & 19 deletions jmeter/telegram-token.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@
<stringProp name="Argument.value">nmasse_itix</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="album_name" elementType="Argument">
<stringProp name="Argument.name">album_name</stringProp>
<stringProp name="Argument.value">2020-04-04-9-mois</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="media_id" elementType="Argument">
<stringProp name="Argument.name">media_id</stringProp>
<stringProp name="Argument.value">953b1e98-de30-4ae0-97b4-cb82f6e487ac</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="raw_photo_filename" elementType="Argument">
<stringProp name="Argument.name">raw_photo_filename</stringProp>
<stringProp name="Argument.value">65e4b775-bc64-4f58-a4d2-4dd109ee303f.jpeg</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="raw_video_filename" elementType="Argument">
<stringProp name="Argument.name">raw_video_filename</stringProp>
<stringProp name="Argument.value">953b1e98-de30-4ae0-97b4-cb82f6e487ac.mp4</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="scenario" elementType="Argument">
<stringProp name="Argument.name">scenario</stringProp>
<stringProp name="Argument.value">${__P(scenario,GetHomePage)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</Arguments>
<hashTree/>
Expand All @@ -59,26 +84,147 @@
<intProp name="LoopController.loops">-1</intProp>
</LoopController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET /album/" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Debug" enabled="false">
<boolProp name="displayJMeterProperties">false</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If GetHomePage" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;GetHomePage&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetHomePage" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If GetAlbum" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;GetAlbum&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetAlbum" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/${album_name}/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If GetMedia" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;GetMedia&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetMedia" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/${album_name}/media/${media_id}/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If GetRawVideo" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;GetRawVideo&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetRawVideo" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/${album_name}/raw/${raw_video_filename}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If GetRawPhoto" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;GetRawPhoto&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetRawPhoto" 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">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">${server_port}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/s/${telegram_username}/${telegram_token}/album/${album_name}/raw/${raw_photo_filename}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="Response Times Over Time" enabled="false">
Expand Down

0 comments on commit 6add05c

Please sign in to comment.