Browse Source

jmeter scripts now support the five scenarios

master 1.0.0
Nicolas Massé 5 years ago
parent
commit
6add05cc4d
  1. 15
      jmeter/run.sh
  2. 148
      jmeter/telegram-token.jmx

15
jmeter/run.sh

@ -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

148
jmeter/telegram-token.jmx

@ -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/>
@ -59,7 +84,19 @@
<intProp name="LoopController.loops">-1</intProp>
</LoopController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET /album/" enabled="true">
<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>
@ -80,6 +117,115 @@
</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">
<boolProp name="ResultCollector.error_logging">false</boolProp>

Loading…
Cancel
Save