๐ ํน์ ๋ณ์ ๊ทธ๋ํ ์ถ๋ ฅ (JMeter Dashboard ํ์ฉ)
1. ๋ณ์ ์ค์
๊ทธ๋ํ๋ก ๋ํ๋ผ ๋ณ์๊ฐ์ ์ง์ ํ๋ค. ์๋๋ ๋๋ค๊ฐ์ ๋ณ์์ ์ฝ์ ํ๊ธฐ ์ํด JSR223 Sampler๋ฅผ ์ด์ฉํด sampleTime ์ด๋ผ๋ ๋ณ์์์ ์์์ ์ ์๊ฐ์ ๋ฃ์ด์ฃผ๋๋ก ํ์๋ค.
import java.util.concurrent.ThreadLocalRandom;
int[] array = ThreadLocalRandom.current().ints(0, 1000).distinct().limit(5).toArray();
vars.put("sampleTime", String.valueOf(array[0]));
2. user.properties ์ค์
์ปค์คํ ๊ทธ๋ํ ์์ฑ์ ์ํด ์๋ property๋ฅผ ์ถ๊ฐํด์ค๋ค.
๐ ํ์ผ๊ฒฝ๋ก : (JMeter ์ค์นํด๋)/bin/user.properties
sample_variables=sampleTime
# sample graph
jmeter.reportgenerator.graph.custom_SampleGraph.classname=org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer
jmeter.reportgenerator.graph.custom_SampleGraph.title=Payload sample graph
jmeter.reportgenerator.graph.custom_SampleGraph.property.set_Y_Axis=value
jmeter.reportgenerator.graph.custom_SampleGraph.property.set_X_Axis=message
jmeter.reportgenerator.graph.custom_SampleGraph.property.set_Content_Message=Number of Hits :
jmeter.reportgenerator.graph.custom_SampleGraph.property.set_granularity=10
jmeter.reportgenerator.graph.custom_SampleGraph.property.set_Sample_Variable_Name=sampleTime
Property ์ค๋ช
Attribute | Description |
title | ๊ทธ๋ํ ์ด๋ฆ |
set_X_Axis | ๊ทธ๋ํ์ X์ถ ์ด๋ฆ |
set_Y_Axis | ๊ทธ๋ํ์ Y์ถ ์ด๋ฆ |
set_Content_Message | ์ปค์๊ฐ ๊ทธ๋ํ์ ํ ์ง์ ์ ์์ ๋ ํ์๋๋ ๋ฉ์์ง๋ฅผ ์ค์ |
set_granularity | ์๊ฐ ๋ถํฌ ์ธ๋ถ์ฑ (ms) |
set_Sample_Variable_Name | ๊ทธ๋ํ๋ก ํ์ํ๋ ค๋ ๋ณ์๋ช |
3. Jmeter ํ ์คํธ ์ํ
- ํ ์คํธ ์ํ ์ View Results Tree๋ฅผ ๋ถ๋ฌ์ csv ๋๋ jtl ํ์ผ์ด ์์ฑ๋๋๋ก ์ค์ ํด์ค๋ค. (ํ์)
- Thread Group์ Loop Count๋ฅผ ์ฆ๊ฐ์์ผ ๋ณ์๊ฐ์ด ์ง์์ ์ผ๋ก ๋ณํํ๋๋ก ํ๋ค.
4. Generate HTML Report
๊ฒฐ๊ณผ๋ฅผ JMeter Dashboard Report๋ก ๋ณผ ์ ์๋๋ก Generateํ๋ ๊ธฐ๋ฅ์ด๋ค. CSV or JTL ํ์ผ์ ์ฝ๊ณ ์ฒ๋ฆฌํ์ฌ ๊ทธ๋ํ view๋ฅผ HTML ํ์ผ๋ก ์์ฑํด์ค๋ค.
- Jmeter ์๋จ๋ฉ๋ด Tools - Generate HTML report ์ ํ
- Results file : ํ ์คํธ ์ํ์ผ๋ก ์์ฑ๋ jtl ํ์ผ ์ ํ
- user.properties file: user.properties ํ์ผ ์ ํ
- Output directory: ๊ฒฐ๊ณผ ํ์ด์ง๋ฅผ ์์ฑํ ๊ฒฝ๋ก ์ ํ (๋น์ด ์์ด์ผ ํจ)
5. ๊ฒฐ๊ณผ ๊ทธ๋ํ ํ์ธ
์ง์ ํ Output Directory ๊ฒฝ๋ก๋ก ์ด๋ํ์ฌ index.html๋ฅผ ๋ธ๋ผ์ฐ์ ๋ก ์คํํ๋ค. ์ง์ ๋ง๋ ์ปค์คํ ๊ทธ๋ํ๋ฅผ ํ์ธํ๊ธฐ ์ํด ์ข์ธก Customs Graphs๋ฅผ ๋ค์ด๊ฐ๋ฉด ๋ณ์๊ฐ์ ๋ณํ๋ฅผ ๊ทธ๋ํ๋ก ํ์ธ ๊ฐ๋ฅํ๋ค.
์ฐธ๊ณ ๋ฌธ์