ä»ããï¼å㧠jmeter ã®ä½¿ãæ¹ã身ã«ä»ãããï¼è² è·ãã¹ãå ¥éï¼
Apache jmeterã¯ï¼Webã¢ããªã®ããã©ã¼ãã³ã¹è¨æ¸¬ã®ããã®ç¡æãã¼ã«ã
ãã®ãã¼ã«ã®åæ©ãï¼ä»ããï¼åã§ç¿å¾ããããã®è¨äºã
æ¬å½ã«ï¼åãã£ãããªã®ã§éä¸ãã¦é ãããã
(1) DL
jmeterããã¦ã³ãã¼ãããã
JMeter Downloads
http://jmeter.apache.org/download_jmeter.cgi
http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
ææ°ç Binary ã® zip ãè½ã¨ãã
ãããâ»ããã¼ãã³ãã®äººâãããã§ããããã¢ã¦ãã¨ããã¦é ãã¾ãããããã¨ããããã¾ããã
(2) ãµã¼ã
åé ã®ãã¦ã³ãã¼ãå®äºãå¾ ããã«ï¼localhost ã®ãµã¼ããç«ã¡ä¸ããã
ãããâ»ãµã¼ããç¡ã人âãå ã«10åããã¦ï¼ã¯ã³ã¯ãªãã¯ã§XAMPPãã¤ã³ã¹ãã¼ã«ãã¦ãã ããã
(3) ãã¼ã¸
åé ã®ãµã¼ãèµ·åå®äºãå¾ ããã«ï¼ãµã¼ãä¸ã«ãã¹ã対象ãã¼ã¸ãè¨ç½®ããã
é©å½ã§ãããä¸è¨ã®ã³ã¼ããã³ããã㦠ãx.phpã 㧠htdocs ç´ä¸ã«ä¿åã
<?php // ç¾ä¸å足ãç®ãã for( $sum = $i = 0; $i < 1000000; $i ++ ) { $sum += $i; } echo $sum; ?>
(4) jmeterèµ·å
ä»ãããã¦ã³ãã¼ããçµãã£ã¦ããã¯ããªã®ã§ï¼è§£åã
解ååã°ã§1:00ãçµéããã¯ãã
解åä¸ï¼æ¬¡é ã®ããã¹ãè¨ç»ä½æãã®æã«ç®ãéãã¦ããã
bin/jmeter.bat ãå®è¡ãjmeterãèµ·åããã
ãããâ»èµ·åããªã人âãJREãå ¥ãã¦ããªãã£ãããã§ãããããã¨ããããã¾ããã
(5) ãã¹ãè¨ç»ä½æ
å·¦ãã¤ã³ã®ããã¹ãè¨ç»ããå³ã¯ãªãã¯ãï¼ã追å ãâãã¹ã¬ããã°ã«ã¼ããã
- ã¹ã¬ããæ°ï¼ 50
- Ramp-Upæéï¼ç§ï¼ï¼ 10ããï¼âã¹ã¬ããç«ã¡ä¸ãæéã®ãã¨ï¼
ã¨å ¥åã
å·¦ãã¤ã³ã®ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯ãï¼ã追å ãâããµã³ãã©ã¼ãâãHTTPãªã¯ã¨ã¹ããã
- ãµã¼ãåã¾ãã¯IPï¼ localhost
- ãã¹ï¼ ./x.php
ã¨å ¥åã
å·¦ãã¤ã³ã®ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯ãï¼ã追å ãâããªã¹ãã¼ãâãçµæã表ã§è¡¨ç¤ºãã
Ctrl+S ãï¼ä¿åã
(6) jmeterå®è¡
ãã¼ã«ãã¼ã§ãå®è¡ãâãéå§ãã
ç»é¢å³ä¸ã®ã©ã³ããç·è²ï¼å®è¡ä¸ãçµäºããã¨ç¡è²ã«ã
(7) çµæ
å·¦ãã¤ã³ã®ãçµæã表ã§è¡¨ç¤ºããé¸æãï¼ãªã¯ã¨ã¹ããããã®å®è¡æéãªã©ã表示ãããã
表ãé¸æãCtrl + AãCtrl + Cãã¨ã¯ã»ã«ã«ãã¼ã¿ãè²¼ãä»ãããçµãã£ãã
ãã¦ã³ãã¼ãéå§ãããã¹ããå®è¡ãã¦æå¾ã®Ctrl+Cã¾ã§ï¼ç§ã¯ 2:58 ãããã¾ããã
ç®æ¨
ï¼åéããã¦ï¼
- jmeterã®ãã¹ãè¨ç»
- ã¹ã¬ããã°ã«ã¼ãï¼å¤äººæ°ã§ä¸æã«å®è¡ãããæé ï¼
- ãµã³ãã©ã¼ï¼ãªã¯ã¨ã¹ããéãããã®ç©ï¼
- ãªã¹ãã¼ï¼çµæãè¦ãããã®ç©ï¼
- ã¹ã¬ããã°ã«ã¼ãï¼å¤äººæ°ã§ä¸æã«å®è¡ãããæé ï¼
ã¨ããé層æ§é ãç解ã§ããã°OKã
解説
10 ç§ã®éã« 50 ã®åæã¢ã¯ã»ã¹ãçããå ´åã®PHPãã¼ã¸ã®å®è¡æéãè¨æ¸¬ããã
表ã®çµæãè¦ãã¨ï¼æããï¼æåã®ï¼ã¢ã¯ã»ã¹ç®ã ãã¯100ããªç§ä»¥ä¸ããã£ã¦ãã¦ï¼ãã¨ã®æ¹ã®ãªã¯ã¨ã¹ãã«ã¤ãã¦ã¯æ°ããªç§ã§æ¸ãã§ãã¾ã£ã¦ããã®ã§ã¯ãªãã ãããã
å®éã®è² è·ãã¹ãã«ããã¦ããã¹ãäºã¯ï¼Webã¢ããªã±ã¼ã·ã§ã³ä¸ã®ä»ã®ãã¼ã¸ã«ã¤ãã¦ãï¼åæ§ã«å®è¡æéãç®åºãããã¨ã§ããã
ãã®ããã«ã¯ï¼ã¹ã¬ããã°ã«ã¼ãã«ããã«ãµã³ãã©ã¼ã追å ãã¦ããã°ããã
ãµã³ãã©ã¼ã¯ï¼ããªã¯ã¨ã¹ãã§éããã©ã¡ã¼ã¿ãã®æããGETãPOSTã®ãã©ã¡ã¼ã¿ãè¨å®ããäºãã§ããã
ãµã³ãã©ã¼ã®å¦ççµæãåå¾ã»åæããããã«ã¯ï¼ã¹ã¬ããã°ã«ã¼ãã«å種ãªã¹ãã¼ã追å ãã¦ããã
ãªã¹ãã¼ãåå¾ãããã¼ã¿ããã¨ã«ï¼ã¢ããªã±ã¼ã·ã§ã³å ã§ã®åã¢ã¯ã·ã§ã³ã®å¹³åå®è¡æéãç®åºãï¼ããã«ããã¯ãè¦æ¥µãããï¼å®éç¨ã¸ã®èæ§ã®æç¡ãå¤å®ãããããã
ãªãå®éã«ã¯ï¼è² è·ã®ããããã·ã³ã¨è² è·ãè¨æ¸¬ãããã·ã³ãåä¸ã§ãã£ã¦ã¯ãããªãã
Tips 1 ï¼å¤é¨ãã©ã¡ã¼ã¿ã®èªã¿è¾¼ã¿
ãã°ã¤ã³å¦ççãããå ´åï¼å ¨ã¦ã®åæã¢ã¯ã»ã¹ãåãã¦ã¼ã¶åã§ãã°ã¤ã³ããããã«ã¯ãããªãã
åã ã®ãªã¯ã¨ã¹ãã«ï¼ããããç°ãªããã©ã¡ã¼ã¿ãæããã¦ãããã¨ãã§ããã
ãã¹ã¬ããã°ã«ã¼ãããå³ã¯ãªãã¯ãï¼ã追å ãâãè¨å®ã¨ã¬ã¡ã³ããâãCSV DataSet Configãã§CSVãã¡ã¤ã«ããå¤é¨ãã©ã¡ã¼ã¿ãèªã¿è¾¼ããã¨ãã§ããã
CSVãã¡ã¤ã«ã«
user1,abc
user2,xyz
ã®ããã«æ¸ãã¦ãããç½®ãå ´ã¯ï¼.jmxãã¡ã¤ã«ã¨åãå ´æãªã©ã
jmeterä¸ã§ã¯ï¼CSVè¨å®ã§
- Filename : csvãã¡ã¤ã«ã®ãã¹
- Variable Names : username,pass (é©å½ãªå¤æ°å)
ãµã³ãã©ã¼ã®ããªã¯ã¨ã¹ãã§éããã©ã¡ã¼ã¿ãã§
- ååï¼ Webã¢ããªã®èªè¨¼ããã°ã©ã ãåãä»ããformå¤æ°å
- å¤ï¼ ${username} ã¨ã ${pass} ã®ããã« Variable Names ãå¼ç¨
ããã¨ï¼ãã¹ãå®è¡æã«ã¯CSVãã¡ã¤ã«ä¸ã®å¤ããã©ã¡ã¼ã¿ã¨ãã¦å©ç¨ãããã
ãã©ã¡ã¼ã¿ã®ã¬ã³ã¼ãæ°ã¯ï¼åæã¢ã¯ã»ã¹æ°ãããå¤ããã¦ãããã¨ã
Tips 2 ï¼ãããã·æ©è½ã使ã£ã¦ãã¹ãã±ã¼ã¹ãèªåçæ
ãªã¯ã¨ã¹ãURLãjmeterã«ãã¡ãã¡æå
¥åããã®ã¯å¤§å¤ã ã
ãããããããã«ï¼ãã©ã¦ã¶ä¸ã®æåããã¹ãã±ã¼ã¹ã«ã¤ã³ãã¼ããã¦ãã¾ãæ¹æ³ãããã
jmeterãProxyãµã¼ãã«ãã¦ï¼ãã©ã¦ã¶ããã®ãªã¯ã¨ã¹ãã«jmeterã仲ä»ãããã®ã ã
ããããã°ï¼ãã©ã¦ã¶ãéã£ããªã¯ã¨ã¹ããjmeterãèªã¿åãï¼ãã¹ã¬ããã°ã«ã¼ãã以ä¸ã«èªåã§è¿½å ãã¦ãããã
ãã®æ¹æ³ã¯ä¸è¨ãµã¤ããªã©ã«è©³ãããåå¿è ã»å ¥éè ã®ããã®æ å ±ãè±å¯ã
- ãã¹ãè¨ç»ã®èªåä½æ(HTTP Proxy Serverã®å©ç¨) http://www.stackasterisk.jp/tech/engineer/jmeter03_02.jsp#3
- Jakarta JMeter:ãããã·ãµã¼ã http://www.techscore.com/tech/ApacheJakarta/JMeter/6.html
- JMeter proxy Step-by-step http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf
ããã©ã¼ãã³ã¹ãã¹ãå®è¡åã«ã¯ï¼Webãµã¤ãã«ç¾å®çãªéã®ãã¹ããã¼ã¿ãæ¿å
¥ãã¦ãããã¨ã
ä¸è¨è¨äºãªã©ãåèã«ãªãã¨æãã
大éã®ãã¹ããã¼ã¿ãå¿«é©ã«ä½ãï¼ã¤ã®ã³ã - è² è·ãã¹ãã®ããã«Excelï¼VBAããã¾ã使ã
http://d.hatena.ne.jp/language_and_engineering/20080929/1222698370
é¢é£ããè¨äºï¼
ï¼ï¼åã§ï¼ã¤ã®ãã¹ããã¼ã«ãç¿å¾ããã(JMeter + qUnit + Selenium) - 主ã«è¨èªã¨ã·ã¹ãã éçºã«é¢ãã¦
http://d.hatena.ne.jp/language_and_engineering/20081018/1224254142
大éã®ãã¹ããã¼ã¿ãå¿«é©ã«ä½ãï¼ã¤ã®ã³ã - è² è·ãã¹ãã®ããã«Excelï¼VBAããã¾ã使ã - 主ã«è¨èªã¨ã·ã¹ãã éçºã«é¢ãã¦
http://d.hatena.ne.jp/language_and_engineering/20080929/1222698370
æ¥æ¬äººã®æ°åã®ãã¹ããã¼ã¿ãï¼Excel VBAã§ã©ã³ãã ã«çæããããï¼ã²ãããªã使ã£ã大éã®ããã¼ãã¼ã¿ï¼ - 主ã«è¨èªã¨ã·ã¹ãã éçºã«é¢ãã¦
http://d.hatena.ne.jp/language_and_engineering/20120328/p1
ãã¹ãããã¼ã¸ã£ã«ãªã£ããï¼ã©ãããï¼ SEã®è¦ç¹ã§ã®æ¸è©ï¼ãç¾å ´ã®ä»äºãããªããªé²ã ã½ããã¦ã§ã¢ãã¹ãææ³ã - 主ã«è¨èªã¨ã·ã¹ãã éçºã«é¢ãã¦
http://d.hatena.ne.jp/language_and_engineering/20110419/p1
ã