JMeterã«ããè² è·è©¦é¨ããã®1ãå°å ¥ããå®è¡ã¾ã§
JMeterã¨ã¯
Apache JmeterãJakarta Projectã«ããã¦éçºããã¦ããã½ããã¦ã§ã¢ã
ã¯ã©ã¤ã¢ã³ããµã¼ãã·ã¹ãã ã®ããã©ã¼ãã³ã¹æ¸¬å®/è² è·è©¦é¨ãè¡ãããã¼ã«ã§ãã
ãªã¼ãã³ã½ã¼ã¹ã§éçºããã¦ããã®ã§ãç¡åã§å©ç¨ãããã¨ãã§ãã¾ãã
Webã¢ããªã±ã¼ã·ã§ã³ã¨Webãµã¼ãã®æ§è½æ¸¬å®ã«å©ç¨ããã¦ãã¾ãã
Javaã§æ¸ããã¦ããã®ã§WindowsãLinuxã§ãç°å¢ä¾åããã«å©ç¨ã§ãã¾ãã
è² è·ããããã ãã§ã¯ãªãã¬ã¹ãã³ã¹ã®ç¢ºèªãã§ããã®ã§ã"ããä¸å®ã®è² è·ããããå ´åã«ãå¿çãæ£ç¢ºã«è¿ããã"ã¨ãã£ãæ¤è¨¼ãå¯è½ã§ãã
JMeterã®åä½
ã¤ã³ã¹ãã¼ã«ããç°¡åãªãã¹ãã·ããªãªã®ä½æãçµæã®è¦æ¹ã¾ã§ãç´¹ä»ãã¾ãã
ç§ã¯æå
ã«ããWindowsãã·ã³ã®JMeterã§ãã¹ãã·ããªãªãä½æãããããlinuxãµã¼ãã§å®è¡ããã¨ããæ¹æ³ãè¡ã£ã¦ãã¾ãã
以ä¸ã«Linuxã§ã®ã¤ã³ã¹ãã¼ã«æ¹æ³ãè¨è¼ãã¾ãã
ã¤ã³ã¹ãã¼ã«
Javaã§æ¸ããã¦ããã®ã§J2SDK1.4以ä¸ãå¿
è¦ã§ãã
JDKã以ä¸ã®ãµã¤ãããå
¥æãã¦ãã¾ãããã
http://www.oracle.com/technetwork/java/javase/downloads/index.html
å®è¡æ¨©ã®ä»ä¸
chmod +x /home/work/jdk-6u27-linux-x64-rpm.bin
å®è¡
./jdk-6u27-linux-x64-rpm.bin
ç°å¢å¤æ°JAVA_HOMEè¨å®
export JAVA_HOME=/usr/java/default
確èª
java -version java version "1.6.0_27" Java(TM) SE Runtime Environment (build 1.6.0_27-b07) Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
JMeterã®å
¥æ
以ä¸ã®ãµã¤ãããææ°çããã¦ã³ãã¼ããã¦ãã¾ãããã
http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
å±éã¨è¨ç½®
tar zxvf jakarta-jmeter-2.5.tgz mv jakarta-jmeter-2.5 /usr/local/ ln -s /usr/local/jakarta-jmeter-2.5 /usr/local/jmeter
ããã ãã§OKã§ãã
Windowsã§ã®ã¤ã³ã¹ãã¼ã«ãã»ã¨ãã©åãæµãã§ãã
JDKãã¤ã³ã¹ãã¼ã«ããjmeterãå±éããã©ã«ãã«è¨ç½®ããã ãã§ãã
èµ·åããã¨ãã¯ãbin\jmeter.batãå®è¡ãã¾ãã
ãã¹ãã·ããªãªã®ä½æ
(Windows)
bin\jmeter.batãèµ·åãããã¨ä»¥ä¸ã®ãããªç»é¢ã表示ããã¾ãã
ãã®ç»é¢ãããã¹ãã·ããªãªãä½æãã¦ããã¾ãã
ã¾ãã¯ãããããã¼ã¸ã«ã1人ã®äººã訪ãããã¨ãããã¹ãã·ããªãªãä½æãããã¨æãã¾ãã
ããã¹ãè¨ç»ããå³ã¯ãªãã¯ãã¦ãã追å ãâãThreads(Users)ãâãã¹ã¬ããã°ã«ã¼ãããé¸æãã¾ãã
ããã§ã¹ã¬ããã°ã«ã¼ãã追å ããã¾ããã
追å ããã¹ã¬ããã°ã«ã¼ããã¯ãªãã¯ããã¨ãã¹ã¬ããããããã£ç»é¢ãå³å´ã«è¡¨ç¤ºããã¾ãã
ã¹ã¬ããæ°ã®ã¨ããã«ã1ããå
¥åãã¾ãã
ãã®ã¹ã¬ããæ°ã¯æ³å®ããã¦ã¼ã¶æ°ã«å¤ãã¾ãã
次ã«HTTPãªã¯ã¨ã¹ãã®è¨å®ãè¡ãã¾ãã
ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯ãã¦ãã追å ãâãè¨å®ã¨ã¬ã¡ã³ããâãHTTPãªã¯ã¨ã¹ãåæå¤è¨å®ããé¸æãã¾ãã
[ãµã¼ãåã¾ãã¯IP]ã®ã¨ããã«ãã¹ããããµã¼ãã®IPã¢ãã¬ã¹ãå
¥åãã¾ãã
HTTPãªã¯ã¨ã¹ãå¦çãè¡ãçºã«ãµã³ãã©ã¼ã追å ãã¾ãã
ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯ã追å ãâããµã³ãã©ã¼ãâãHTTPãªã¯ã¨ã¹ãããé¸æãã¾ãã
[ãã¹]ã«ãªã¯ã¨ã¹ããéããã¼ã¸åï¼ããã°ã©ã åï¼ãæå®ãã¾ãã
ãµã¼ãåã¨IPã¢ãã¬ã¹ã¯å
ã»ã©ã®åæè¨å®ã®å¤ãå©ç¨ãããã®ã§ã空æ¬ã§å¤§ä¸å¤«ã§ãã
ä»åã¯index.phpã«ãªã¯ã¨ã¹ããéãã¾ãã
ãã¹ãããçµæãä¿åãããªã¹ãã¼ãè¨å®ãã¾ãã
ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯âã追å ãâããªã¹ãã¼ãâãçµ±è¨ã¬ãã¼ãããé¸æãã¾ãã
çµæããã¡ã¤ã«ã«ä¿åãããå ´åã¯ãã¡ã¤ã«åãå ¥åãã¾ãããã
é ç®å | æå³ |
---|---|
Samples | ãµã³ãã«æ°ï¼å®è¡åæ°ï¼ |
Average | ãµã³ãã«ã®åè¨ã®å¹³åå¤ |
Median | ãµã³ãã«ã®ä¸å¤®å¤ |
90% Line | ãµã³ãã«ã®90%ã¯ãã®å¤ãããä½ããªãå¤ |
Min | æå°å¤ |
Max | æå¤§å¤ |
Error | ãµã³ãã«å ã®ä½%ãã¨ã©ã¼ã«ãªã£ããï¼ä»åã¯ã¢ãµã¼ã·ã§ã³è¨å®ãã¦ãªãã®ã§é¢ä¿ãªãï¼ |
Throughput | åä½ãããã®å¦çæ° |
KB/Sec | ç§éã«ä½KBå¦çããã |
âééã£ã¦ãããæãã¦ãã ããã
ãã¹ããã¡ã¤ã«ã®ä¿å
ããã¡ã¤ã«ãâããã¹ãè¨ç»ãååãã¤ãã¦ä¿åããé¸æãjmxãã¡ã¤ã«ãä¿åãã¦ãã ããã
ãã¹ãå®è¡
å
ã»ã©ä½æããjmxãã¡ã¤ã«ãJMeterãå
¥ããLinuxã«è»¢éãã¦ãã ããã
cd /usr/local/jmeter/bin chmod +x jmeter ./jmeter -n -t /tmp/test.jmx
-n ãªãã·ã§ã³ã¯NON-GUIã¢ã¼ãã§JMeterãå®è¡ãããªãã·ã§ã³ã§ãã
-t ãªãã·ã§ã³ã§å®è¡ããjmxãã¡ã¤ã«ãæå®ã§ãã¾ãã
ããã§JMeterã®å®è¡ãå¯è½ã§ãã
ä»åã¯"ä¸äººã®ã¦ã¼ã¶ãindex.phpã«ä¸åã¢ã¯ã»ã¹ãã"ã¨ããã ããªã®ã§ãããã«å®è¡ã¯çµããã¨æãã¾ãã
ããã§ä¸çªç°¡åãªãã¹ãã¯å®äºãã¾ããã
次ã«ã¢ãµã¼ã·ã§ã³ã®è¨å®ããã¦ã¿ã¾ãããã
ã¢ãµã¼ã·ã§ã³ã¨ã¯ããã¹ããã¦ãããµã¼ãããã®å¿çãæ¤æ»ãããã®å¿çãæ£ãããã®ãã©ããããã§ãã¯ããããã®ãã®ã§ãã
ä¾ãã°å
ã»ã©ã®index.phpã¯ããããããï¼ãã¨è¡¨ç¤ºããããã°ã©ã ã ã£ãã¨ãã¾ãã
ã¢ãµã¼ã·ã§ã³ãè¨å®ããªãã£ãå ´åãã¡ããã¨ãããããï¼ãã表示ããã¦ãããã©ããã確èªããè¡ã¯ããã¾ããã
ãããããããããä¸å®ã®è² è·ãè¶
ããã¨ã503ã¨ã©ã¼ã帰ã£ã¦ããããããã¾ããã
ã¡ããã¨ãããããï¼ãã表示ããã¦ãããã確èªããçºã«ã¢ãµã¼ã·ã§ã³ã追å ãã¾ãã
ãã¹ã¬ããã°ã«ã¼ããâã追å ãâãã¢ãµã¼ã·ã§ã³ãâãã¢ãµã¼ã·ã§ã³ã
ãã¹ããã¿ã¼ã³ã®é¨åã«æ¤æ»ãããæååãå
¥åãã¾ãããã
ä»åã¯ãããããï¼ãã帰ã£ã¦ãããã確èªããã®ã§ããã®ããã«å
¥åãã¦ãã ããã
ãªã¹ãã¼ã追å ãã¦ããã¾ãããã
ãã¹ã¬ããã°ã«ã¼ããâã追å ãâããªã¹ãã¼ãâãã¢ãµã¼ã·ã§ã³çµæã
ã¢ãµã¼ã·ã§ã³çµæã使ãã°ããµã¼ãããã®å¿çã®å 容ã¾ã§ç¢ºèªã§ããã®ã§ä¾¿å©ã§ãã
ã¨ããããä»æ¥ã¯ããã¾ã§ã