Browse Source

Phase III Task 9

master
Yutsuo 7 years ago
parent
commit
712d9e044d
  1. 8
      README.md
  2. 92
      View Results Tree.jmx
  3. 8
      prometheus.yml

8
README.md

@ -28,4 +28,10 @@ Levante a página e o serviço REST em Swarm Mode. Escale o container do NodeJS
Sétima tarefa:
Faça um teste de escala de 6 threads em paralelo no serviço /restricted usando JMeter, validando se o retorno do servidor está conforme esperado. Mande um print de 'docker stats' enquanto o teste roda para demonstrar a distribuição de gasto de CPU entre as instâncias do container de NodeJS e um print dos resultados do JMeter.
Faça um teste de escala de 6 threads em paralelo no serviço /restricted usando JMeter, validando se o retorno do servidor está conforme esperado. Mande um print de 'docker stats' enquanto o teste roda para demonstrar a distribuição de gasto de CPU entre as instâncias do container de NodeJS e um print dos resultados do JMeter.
Nona tarefa:
Rode o mesmo teste anterior, mas agora monitore o andamento do teste do JMeter pelo Grafana por meio do Prometheus. Monte um painel Grafana com a qtde de requisições cujo assert JMeter foi OK, qtos foi com erro e a qtde de requisições por segundo que o JMeter está lançando.
**Dica:** https://github.com/johrstrom/jmeter-prometheus-plugin

92
View Results Tree.jmx

@ -19,13 +19,52 @@
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">48</stringProp>
<stringProp name="ThreadGroup.num_threads">6</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" 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">localhost</stringProp>
<stringProp name="HTTPSampler.port">3001</stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/restricted</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>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<SyncTimer guiclass="TestBeanGUI" testclass="SyncTimer" testname="Synchronizing Timer" enabled="true">
<intProp name="groupSize">0</intProp>
<longProp name="timeoutInMs">0</longProp>
</SyncTimer>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">token</stringProp>
<stringProp name="Header.value">eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InVzZXIxIiwicGFzc3dvcmQiOiJwYXNzMSIsInN1YmplY3QiOiJub3JtYWxfdXNlciIsImlzc3VlciI6Imh0dHA6Ly95b3VjYW50cnVzdG1lLmlvIiwic2NvcGUiOiJ1c2VyIiwiaWF0IjoxNTQ3NDcxMTMxfQ.cGSFZW5F5-R-eJgrawZOYC5I_35ZUxEbzIUM3rk5OWI</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
@ -82,6 +121,7 @@
<sentBytes>true</sentBytes>
<url>true</url>
<threadCounts>true</threadCounts>
<sampleCount>true</sampleCount>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
@ -89,20 +129,44 @@
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<com.github.johrstrom.listener.PrometheusListener guiclass="com.github.johrstrom.listener.gui.PrometheusListenerGui" testclass="com.github.johrstrom.listener.PrometheusListener" testname="Prometheus Listener" enabled="true">
<objProp>
<name>johrstrom.save_config</name>
<value class="com.github.johrstrom.listener.PrometheusSaveConfig">
<label>false</label>
<code>false</code>
<success>false</success>
<assertions>true</assertions>
<threads>true</threads>
<port>9027</port>
<assertionClass>io.prometheus.client.Counter</assertionClass>
</value>
</objProp>
</com.github.johrstrom.listener.PrometheusListener>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion code 200" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="49586">200</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">8</intProp>
<stringProp name="Scope.variable">code</stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion code 500" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="52469">500</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">8</intProp>
<stringProp name="Scope.variable">code</stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">token</stringProp>
<stringProp name="Header.value">eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InVzZXIxIiwicGFzc3dvcmQiOiJwYXNzMSIsInN1YmplY3QiOiJub3JtYWxfdXNlciIsImlzc3VlciI6Imh0dHA6Ly95b3VjYW50cnVzdG1lLmlvIiwic2NvcGUiOiJ1c2VyIiwiaWF0IjoxNTQ3NDcxMTMxfQ.cGSFZW5F5-R-eJgrawZOYC5I_35ZUxEbzIUM3rk5OWI</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>

8
prometheus.yml

@ -12,4 +12,10 @@ scrape_configs:
static_configs:
- targets: ['app:3001'] # mysqld_exporter address and port
labels:
alias: 'app1-02' # alias name given to this instance
alias: 'app1-02' # alias name given to this instance
- job_name: 'jmeter' # Job name
metrics_path: /metrics
static_configs:
- targets: ['192.168.5.1:9027'] # address and port
labels:
alias: 'jmeter' # alias name given to this instance
Loading…
Cancel
Save