ããã§JMeterã«ã€ããŠæžãã®ã¯åããŠã§ã¯ãããŸããããèšäºã®çŠç¹ãããªãçãããç解ãã«ããã§ãã ãããã£ãŠããã®èšäºã¯åå¿è ã«ãšã£ãŠèå³æ·±ããã®ã§ãã
ã¯ããã«
ã©ããããããç§ã¯æ°ããããŒã«-JMeter-ãç¿åŸãå§ããŸããããã¢ã¯ã·ã§ã³ã®ã¬ã€ããšããŠæ¬æ Œçãªã¬ã€ããèŠã€ããããšãã§ããŸããã§ããã åŸã ã«ãããªãæçšãªèšäºãããã°ããŠãŒã¶ãŒææžãæŽçããŠãäœããç解ãå§ããŸããã ãããŠãäœããå§ããããšæã£ãŠããã®ã¯ç§ã ãã§ã¯ãªããããããªããšæ±ºããŸããã æ§ç¯ã®ååãšããŒã«èªäœã®ããžãã¯ã®ããã€ããç¿åŸããŸãã ãã®ãããããã«éå§æ¹æ³ã«é¢ããèšäºããããŸãã
ãã®ããããã®èšäºã§ã¯ã次ã®3人ã®ãŠãŒã¶ãŒã®ããã«ã¹ã¯ãªãããäœæããäŸãèŠãŠãããŸãã
1.ãã°ã€ã³;
2.ã¢ã«ãã ã«æ°ããåçãè¿œå ããŸãã
3.ãããã£ãŒã«åçãå€æŽããŸãã
ãã®ãããããã¯ãœãŒã·ã£ã«ãããã¯ãŒã¯ã®éåžžã®ããžãã¹ããã»ã¹ã§ãã
ãããŠããããã®ç®çã®ããã«ããã®ãããªçµã¿èŸŒã¿ã³ã³ããŒãã³ãã䜿çšãããŸãïŒ
- HTTPãããã·ãµãŒããŒ
- é²é³ã³ã³ãããŒã©ãŒx3
- ãŠãŒã¶ãŒå®çŸ©å€æ°
- CSVããŒã¿ã»ããæ§æx3
- åžžæã¿ã€ããŒ
- åäžã©ã³ãã ã¿ã€ããŒ
- HTTPèªååãããŒãžã£ãŒ
- HTTPãªã¯ãšã¹ãx6
- ãããã°ãµã³ãã©ãŒx3
- HTTP Cookie Manager
- äžåºŠã ãã®ã³ã³ãããŒã©ãŒ
- ããããä»ã®ããã€ãã
èšäºã¯è©³çŽ°ã ãã倧ããã çµæã¯æ¬¡ã®ããã«ãªããŸãã
èªåã¹ã¯ãªããèšé²
äžçªäžã®è¡ã¯ããã©ãã¯ããã¯ã¹ã¡ãœããã䜿çšããŠãã¹ããããµã€ãã®ã¹ã¯ãªãããäœæãããšãããã®æäœã®ãã¹ãŠã®åŸ®åŠããšæ©èœãããããªããšããããšã§ãã ãã®ãããããšãã°ããã®ãµã€ãã¯ãç§ã®ã¹ã¯ãªããã®æçµçãªããŒã¹ã«ãªããSymphony2ããã±ãŒãžã䜿çšããŠäœæãããŸããã ãã®ããããã°ã€ã³/ãã¹ã¯ãŒãããŒã¿ã®éä¿¡ã¯ã/ãã°ã€ã³ããŒãžã®ãã©ãŒã ããçŽæ¥ã§ã¯ãªããååšããªã/ login_checkããŒãžããè¡ãããŸãã ãããŠãããããã¹ãŠã«å¯ŸããŠããŠãŒã¶ãŒã«å¯ŸããŠé衚瀺ã«ãªã£ãŠããå¥ã®ç©ºã®ãã£ãŒã«ããéä¿¡ãããŸãã
HTTPãããã·ãµãŒããŒã¯ããã®ãããªèœãšãç©Žã®æ€åºã«åœ¹ç«ã¡ãŸãïŒããã¯ãä»ã®ãã¹ãŠã®å Žåãšåæ§ã«ãã€ã³ã©ã€ã³èŠçŽ ã§ãïŒã ãããã·ãµãŒããŒã®åäœããšãã¥ã¬ãŒãããåä¿¡ãããªã¯ãšã¹ããšéä¿¡ãããªã¯ãšã¹ãããã¹ãŠèšé²ããŸãã
æºåäœæ¥
HTTP Proxy Serverã¯ãŸã ãã¹ãããªãŒã«è¿œå ããŸããã åãåã£ããã¹ãããããã©ãã«æžãçãããã«ã€ããŠè©±ãåããŸãã åŸã§ãããªãŒã«èŠçŽ ãè¿œå ãããšãçµæãèšé²ããå Žæãããã€ãããããšãããããŸãã ãããã¯ããã³ã€ã«ãïŒ ã¹ã¬ãã ïŒããã¯ãŒã¯ãã³ããïŒã¯ãŒã¯ãã³ã ïŒããŸãã¯ãèšé²ã³ã³ãããŒã©ãŒãèŠçŽ ã«çŽæ¥æžã蟌ãããšãã§ããŸãã åŸè ã®æ¹æ³ã䜿çšããããšããå§ãããŸãã ãŸããå¿ èŠã«å¿ããŠãã°å šäœãäžåºŠã«ç¡å¹ïŒctrl + tïŒã«ã§ããŸãã 第äºã«ããã¹ãæ§é ã®è¿œè·¡ãšåœ¢æãæ¹åãããŸãã
è¿œå ããã³ç·šéã®ããã®ãã¹ãŠã®ã¢ã¯ã·ã§ã³ã¯ãã³ã³ããã¹ãã¡ãã¥ãŒã§ããŠã¹ã®å³ãã¿ã³ãã¯ãªãã¯ããããšã§çºçããŸãã äœæããã¢ã€ãã ã¯ãåã«ãã©ãã°ã¢ã³ãããããã§ããŸãã
ã ããïŒ ãã¹ãèšç»->è¿œå ->ã¹ã¬ãã->ã¹ã¬ããã°ã«ãŒã ; ã¹ã¬ããã°ã«ãŒã->è¿œå ->ããžãã¯ã³ã³ãããŒã©ãŒ->ã¬ã³ãŒãã£ã³ã°ã³ã³ãããŒã©ãŒ
ãã¹ãŠã®èŠçŽ ã«äžåºŠã«æ確ãªååãä»ããããšã匷ããå§ãããŸãã ç§ã®å Žåããããã¯ãããããPicturesããšãLoginãã«ãªããŸãã
HTTPãããã·ãµãŒããŒã䜿çšããã¹ã¯ãªããã®äœæ
æºåæé ãå®äºããããå¿ èŠãªèŠçŽ ããã¯ãŒã¯ãã³ããã«è¿œå ããŸãïŒ ã¯ãŒã¯ãã³ã->è¿œå ->éãã¹ãèŠçŽ -> HTTPãããã·ãµãŒããŒ
å€ãã®èšå®ããããŸãããä»ã®ãšããèå³ãããã®ã¯ããŒãã®ã¿ã§ãã ããŒã8080ãããžãŒã®å Žåãããšãã°8089ãèšå®ã§ããŸãããã®ãã·ã³ïŒ8089ïŒã䜿çšããŠããŸãã ãŸããTarget Controllerãã£ãŒã«ãã®ããã©ã«ãã§ã¯ãuse recording controllerãã§ããããšãããããŸãã ã€ãŸã ãã°ã¯ããã«èšé²ãããŸãã
æ®ãã®ãã£ãŒã«ãã«ã¯è§ŠããŸãããããµã€ãã«é¢ããããå°ãã®æ å ±ãåãåã£ãããããã€ãã®ãã£ãŒã«ããå¿ èŠã«ãªããŸãã
ããŒããèšå®ãããããã©ãŠã¶ã®èšå®ã«ç§»åããŸãã ç§ã¯IEã䜿çšããŠããã ããŒã«-ã€ã³ã¿ãŒããããªãã·ã§ã³-æ¥ç¶-ãããã¯ãŒã¯èšå®ãã¿ã³ ã ãUse proxy server ...ããšããdawsãé 眮ãã2çªç®ã®dawãåé€ããŸãã ã詳现ããèŠãŠããäŸå€ãã«æžãããŠããããšã確èªããããšããå§ãããŸãã ç§ã®å®åã§ã¯ããã¹ãäžã«ãµã€ããæ°ãããã¡ã€ã³ã«ç§»åãããŸããããäŸå€ã«ãªã£ãŠããŸãã ä»®æ³ãŠãŒã¶ãŒã®ã¢ã¯ã·ã§ã³ããã¹ãããããµã€ãã«èšé²ããããYandexãtwitterãFacebookãžã®ããããçš®é¡ã®ãªã³ã¯ãå®å šã«èšé²ãããçç±ãç解ããã®ã«çŽ30åããããŸããã äžè¬ã«ããµã€ãã®ãã¡ã€ã³ãçªç¶ããã«ããå Žåã¯ãåé€ããŸãã
ãã¢ãã¬ã¹ããã£ãŒã«ãã«ãLocalhostããšæžã蟌ã¿ãJMeterããã®ããŒãã8089ããæå®ããŸãã ãã¡ãããåŒçšç¬Šãªãã§ããã¹ãŠã
ããã§ããã¹ãŠãé²é³ããæºåãã§ããŸããã ãããã·ã§JMeterã«æ»ããäžéšã§[ã¹ã¿ãŒã]ãã¿ã³ãã¯ãªãã¯ããŸãã ã¯ãªãã¯ãããšããã©ãŠã¶ã®ãã¹ãŠã®ãŠãŒã¶ãŒã¢ã¯ã·ã§ã³ããäœæããããã°ã€ã³ãèšé²ã³ã³ãããŒã©ãŒã«èšé²ããå§ããŸãã ã¢ã¯ã·ã§ã³ãããã€ãã®ã¹ãããã§èšé²ããŸãã ã¹ã¯ãªããã倧ããããŠç·šéãé£ããå ŽåããããŸãã ãããã£ãŠãæåã«å®è¡ããŠãããããã°ããã®ã¯ããµã€ãäžã®ãŠãŒã¶ãŒã®æ¿èªã§ãã
ãã®ããã[éå§]ãã¯ãªãã¯ããŠããµãŒããŒã§ã®èªèšŒæé ïŒãŸã ãªããããããŸããããç§ã¯æã£ãŠããŸãïŒãšãµã€ãã§ã®èªèšŒæé ãå®è¡ããŸãã JMeterã«æ»ãããåæ¢ããã¯ãªãã¯ããŸãã é²é³ã³ã³ãããŒã©ãŒãèŠãŠã¿ãŸãããïŒããããã®åäŸãããŸãã ããããµãŒããŒã«éä¿¡ããããã®ã§ããµãŒããŒãå¿çããŸããã å匷ããŠæé€ããŸãã
ã¹ã¯ãªããã®ãããã°
ã¹ã¯ãªããã®ãããã°ãšã¯ãããŸããŸãª.jpgã.pngãããã³ãµãŒãããŒãã£ã®ãªãœãŒã¹ãžã®ãªã³ã¯ãåé€ããããšã§ãã ã¹ã¯ãªããã«ã¯ãããã®ãµãŒãããŒãã£ãªãœãŒã¹ã®åå以äžãå«ãŸããŠããŸãããããã¯ããŸããŸãªãœãŒã·ã£ã«ãããã¯ãŒã¯ãYandexããããšã®æ¥ç¶ã§ãã ãããã¯ãã¹ãŠåé€ã§ããŸãïŒåé€ãæŒããŸãïŒã äžè¬ã«ã.jsãã¯ãªãŒã³ã¢ããã§ããŸãã äž»ãªããšã¯ããŠãŒã¶ãŒã®èªèšŒæ å ±ãäœå ã§æž¡ããªã¯ãšã¹ããèŠã€ããããšã§ãã ããŠãçŸããã®ããã«ããŠãŒã¶ãŒããã°ã€ã³ããããŒãžã«å°ããªã¯ãšã¹ããèŠã€ããŠãã ããã ãããã£ãŠã圌ãã¯äžç·ã«ãããŒãžã«è¡ã£ã-ãã°ã€ã³ããããŠãŒã¶ãŒã®è¡åã®æãã¢ãã«åããŸãã
幞ããå¿ èŠãªã¯ãšãªãåé¢ã§ãããšããŸãã ããŠããŸãã¯ç§ãã¡ã¯ããããç¹å®ããããã«æãããŸãã èªã¿ãããååãä»ããŠãã ããïŒ éžæãããã©ããã確èªããã«ã¯ãã¹ã¯ãªãããå®è¡ããå¿ èŠããããŸãã ç§ã®å Žåãã¹ã¯ãªãããå®è¡ãããšããšã©ãŒãçºçããŠå®è¡ãããŸãã å®éã«ã¯ããã¹ãã®ããã«ãµãŒããŒã«ãã°ã€ã³ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãHTTP Autorization ManagerïŒ ã¹ã¬ããã°ã«ãŒã-è¿œå -æ§æèŠçŽ -HTTP Autorization Manager ïŒãããªãŒã®äžéšã«è¿œå ããŸãã çŽæçã§ãã ãªãœãŒã¹ã®ã¢ãã¬ã¹ã¯ã å¿ ã httpïŒ//ããŠãŒã¶ãŒåããã¹ã¯ãŒãã§æžãçããŸãã
ãµãŒããŒã§ã®æ¿èªã«æ¿èªãããŒãžã£ãŒãå¿ èŠãªå ŽåãCookieã¯ãµã€ãã§ã®æ¿èªäžã«å¿ ã䜿çšãããŸãã æ¿èªãããŒãžã£ãŒã®åŸã«CookieãããŒãžã£ãŒãè¿œå ããŸãïŒ TestPlan-è¿œå -æ§æèŠçŽ -HTTP CookieãããŒãžã£ãŒ ïŒã ãŠãŒã¶ãŒããã°ã€ã³ããå¿ èŠããããšããããšã«ãªããšãããããåžžã«ãã®èŠçŽ ãè¿œå ããå¿ èŠããããŸãã
ã¹ã¯ãªãããéå§ããŠãã§ãã¯ããåã«ãçµæããªãŒã®è¡šç€ºèŠçŽ ïŒ ã³ã€ã«-è¿œå -ãªã¹ããŒ-çµæããªãŒã®è¡šç€º ïŒãè¿œå ããŸããããã§ãå®è¡ã確èªã§ããŸãã ãã®èŠçŽ ã¯ãåžžã«äžéšã«é 眮ãããšäŸ¿å©ã§ãã ããããã©ãŠã¶ã®èšå®ã§ããããã·ã䜿çšããããã§ãã¯ããã¯ã¹ãåé€ããå¿ èŠããããŸãããŸã å¿ èŠãããŸããã
ã ãããå®è¡ããããšãã§ããŸãã ïŒctrl + rïŒãéå§ããŸãïŒ
çµæããªãŒã®è¡šç€ºã§ã¯ã次ã衚瀺ãããŸãã
幞éãªããã§ãã ãããŠããã°ã€ã³ããªããŠããå°ãªããšããªã¯ãšã¹ãã¯ãµãŒããŒã«å±ããŸããã ãŠãŒã¶ãŒãæ£åžžã«ãã°ã€ã³ããããšã確èªããã«ã¯ãããªãŒã®åçãèŠãŠãã ããã [ å¿çããŒã¿]ãã¯ãªãã¯ããŸã ã ãµãŒããŒã®å¿çã§ã¯ããŠãŒã¶ãŒèªèšŒãæåããããšã瀺ãæ å ±ãæ¢ããŠããŸãã ç§ã®å Žåãããã¯ãŠãŒã¶ãŒåã«ãªããŸãã æ¿èªåŸãããŒãžã«è¡šç€ºãããŸãã
ã¹ã¯ãªããã¯ãŸã ãããã«ããå¿ èŠããããããããŸããã ããšãã°ãHTTPããããŒãããŒãžã£ãŒãåé€ããŸããã ãããŠããããããªããã°ããã¹ãŠãæ£åžžã«åäœããŸãã åèŠçŽ ãå¿ èŠã§ããããšã確èªããã«ã¯ãããã«åé€ããå¿ èŠã¯ãããŸããããã®èŠçŽ ãç¡å¹ã«ããã ãã§ååã§ãïŒctrl + tïŒ ã
次ã«ããã®ããžãã¹ã«3人ã®ãŠãŒã¶ãŒãåŒãä»ããŸãã ãããè¡ãã«ã¯ããŸãã¯ãšãªã®ãã©ã¡ãŒã¿ãŒåã«é¢ããå°ããªã±ãŒã¹ã¹ã¿ãã£ãå®è¡ããŸãã ç¹å®ã®1人ã®ãŠãŒã¶ãŒããã©ã¡ãŒã¿ãŒåããŸãã
ãã©ã¡ãŒã¿å
ã¯ãšãªããã©ã¡ãŒã¿ãŒåããã«ã¯ãäžçªäžã«ãŠãŒã¶ãŒå®çŸ©å€æ°ãè¿œå ããŸãã ã¹ã¬ãã->æ§æã³ã³ãããŒã©ãŒ->ãŠãŒã¶ãŒå®çŸ©å€æ° äžéšã«è¿œå ãã¿ã³ããããŸãã ããã·ã¥ãã2ã€ã®å€æ°ã§é§åããŸãã ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã®2ã€ã®ãã©ã¡ãŒã¿ãŒã®ã¿ãå€æŽãããŸãã ãããã«é©åãªååãä»ããŸãïŒuserNameãšpasswordã ãããŠãå€ãšããŠãçŸåšã®ãŠãŒã¶ãŒã®ç¹å®ã®å€ãå ¥åããŸãã
ãããã䜿çšããã«ã¯ããã°ã€ã³ãªã¯ãšã¹ãã«ç§»åããç¹å®ã®å€ã®ä»£ããã«$ {variable name}ã®åœ¢åŒã§å€æ°åãæžã蟌ã¿ãŸãã ãã®äŸã§ã¯ããã°ã€ã³-$ {userName}ããã¹ã¯ãŒã-$ {password}ã®Valueãã£ãŒã«ãã«æžã蟌ã¿ãŸãã
ãã©ã¡ãŒã¿ãŒã®åãæž¡ãããããã°ããã«ã¯ãå¥ã®èŠçŽ -Debug Samplerãè¿œå ããŸãã ã¹ã¬ãã->è¿œå ->ãµã³ãã©ãŒ->ãµã³ãã©ãŒã®ãããã° ã ãªã¯ãšã¹ãã«å¿ããŠãã°ã€ã³ããŸãã èŠçŽ ã®èšå®ã§ã¯ãJMeterå€æ°ã®ã¿ãæ®ããæ®ããfalseã«èšå®ããŸãã ããã¯ãå€æ°ã®ã¿ããã£ããããããã§ãã ãããŠããŸã ä»ã«ã¯ãããŸããã
çµæããªãŒã®è¡šç€ºã§çµæã確èªããŸãã å€æ°ãšããŠæž¡ãããã®ã¯å€ã§ãããã¯ãšãªå šäœãå¿ èŠãªãã®ãè¿ããããšã確èªããå¿ èŠããããŸãïŒäžèšãåç §ïŒã
ããã§ã3人ã®ãŠãŒã¶ãŒã«ããŒã¿ã転éã§ããŸãã ãããè¡ãã«ã¯ãCSV Data Set Configã䜿çšããŸãã
CSVããŒã¿ã»ããã®æ§æ
ã¡ã¢åž³ã§.csvãã¡ã€ã«ãäœæããããšããå§ãããŸãã ãŠãŒã¶ãŒã®å Žåããã¡ã€ã«ã¯ãUserName; Passwordããšãã圢åŒã®3è¡ã®ã»ããã§ããå¿ èŠããããŸãã ç§ã®ãã¡ã€ã«ã¯ä»¥äžã®ã¹ã¯ãªãŒã³ã·ã§ããã«ç€ºãããŠããŸãïŒ
次ã«ãCSV Data Set ConfigèŠçŽ ïŒ Add-Config Elements-CSV Data Set Config ïŒãããªãŒã«è¿œå ããŸãã ã³ã€ã«ã§ã¯ãªãããã¹ãèšç»ã®ãŠãŒã¶ãŒå€æ°ã®äžã«è¿œå ããŸãã ãã¡ã€ã«ã®ãã¡ã€ã«åãšããŠããã¡ã€ã«ãžã®ãã«ãã¹ãšãã®ååãæå®ããå¿ èŠããããŸãã 以äžã«ïŒéžæããïŒãšã³ã³ãŒãã£ã³ã°ã瀺ããŸãã ãã¹ãŠã®ããŒã¿ãè±èªã®å Žåããã£ãŒã«ãã¯ç©ºçœã®ãŸãŸã«ã§ããŸãã 以äžã«ããã¡ã€ã«ããèªã¿åãããå€æ°ãæžã蟌ã¿ãŸãã ç§ãã¡ã«ãšã£ãŠã¯ããŠãŒã¶ãŒåãšãã¹ã¯ãŒãã«ãªããŸãã ãã¡ã€ã«ã§äœ¿çšããããããåºåãæåãšããŠã»ãã³ãã³ãæå®ããå¿ èŠããããŸãã 以äžã§ã¯ãå°ãè±èªãç¥ã£ãŠãã人ã«ãšã£ãŠãè«çå€æ°ã®ååã翻蚳ããããšã¯é£ãããããŸããã ã³ã€ã«ãåæ¢ããã ãã§ãªããæåŸã«å°éãããšãã«ãã¡ã€ã«ã®ç¹°ãè¿ããfalseã«èšå®ããå¿ èŠããããŸãã
次ã«ããããã®å€æ°ããŠãŒã¶ãŒå®çŸ©å€æ°ããåé€ããŸãã 空ã®ãŸãŸã«ãªããšããäºå®ã¯æããªãã ãã®åŸãã³ã€ã«èªäœã§ãã¹ã¬ããã®æ° ïŒ Number of Threrads ïŒã3ã«èšå®ãããŸãã
ããã§ãã¹ã¯ãªãããå®è¡ãããããã°ãµã³ãã©ãŒãšçµæããªãŒã®è¡šç€ºã§çµæã確èªã§ããŸãã ããŒã¿ããµãŒããŒããè¿ããããã©ããããŠãŒã¶ãŒã®ååãå«ãŸããŠãããã©ãããå¿ããã«ç¢ºèªããŠãã ããã
ã¢ã«ãã ã«åçãè¿œå ããŸã
ãŠãŒã¶ãŒããã°ã€ã³ããããšãåŠãã ã®ã§ãã¹ã¯ãªããã®æ¬¡ã®éšåã«é²ã¿ãŸãããã ãµã€ãã®ç¹å®ã®ã¢ã«ãã ã«åçãã¢ããããŒãããããšãæããŸãã ãããè¡ãã«ã¯ãé²é³ã³ã³ãããŒã©ãŒãã³ã€ã«ã«è¿œå ãããPhotosããšããååãä»ããŸãã
çµæã®ã¹ã¯ãªãããççž®ããããã«ããµã€ãã®ãŠãŒã¶ãŒãäºåã«æ¿èªããåçã®ã¢ããããŒããéå§ããããŒãžã«ç§»åããŸãã ãã®åŸããã©ãŠã¶ãŒèšå®ã§ãããã·ãå床ãªã³ã«ããã¯ãŒã¯ãã³ãã§Proxy ServerèŠçŽ ã䜿çšããŸãïŒ å¥ã®èšé²ã³ã³ãããŒã©ãŒãæå®ããŸã ïŒã ãŸãã é€å€ããURLãã¿ãŒã³ã§ã¯ãäžèŠãªæ¡åŒµåãã*ã\ãXxxãã®åœ¢åŒã§æå®ããŸãã
éå§ããã©ãã¢ã«ãã ã«èšå ¥ãçµäºã ã¹ã¯ãªããã®ã¯ãªãŒãã³ã°ãéå§ããŸãã åæ§ã«ãçŸå®¹ã®ããã«ããã¢ã«ãã ã«è¡ã£ã-åçãè¿œå ããããšããäžé£ã®ãªã¯ãšã¹ãã®ã¿ãæ®ãããšãã§ããŸãã 次ã®ããã«ãªããŸããã
å®éããã¢ã«ãã ã«è¡ã£ãããšãããªã¯ãšã¹ãã¯æåã§èšé²ãããŸããã 倧ããããšã§ã¯ãããŸãããããã¯ããŒãžã¢ãã¬ã¹ã䜿çšããGETãªã¯ãšã¹ãã§ãã
ãã¡ã€ã«ããµãŒããŒã«éä¿¡ãããªã¯ãšã¹ãã®æ¬æã«æ³šæããŠãã ããã 䟡å€ãããã®ã¯ããã¹ãšãã¡ã€ã«åã ãã§ãã ããã§ã¯ãåãŠãŒã¶ãŒãèªåã®åçãã¢ããããŒãã§ããããã«ããããããã©ã¡ãŒã¿ãŒåããŸãã ãã¡ã€ã«ãžã®ãã¹ããå§ããŸãããã ãã¹ãã®ããã«ãããã¯èå³ããããŸããã ãã¹ãŠã®åçããã©ã«ãã«ããå¯èœæ§ããããŸãã ãããããã¹ãã§ã¯äœåºŠãçºçããå¯èœæ§ããããŸãã ãããã£ãŠãé©åãªåœ¢åŒã®èŠåã«åŸã£ãŠãå€æ°ã«æžã蟌ã¿ãŸãã ãŠãŒã¶ãŒå®çŸ©å€æ°ã«æ»ãã filePathå€æ°ã«åçã®ãããã©ã«ããŒãžã®ãã¹ã®å€ãè¿œå ããŸããããšãã°ãã** DïŒ\ jakarta-jmeter-2.5.1 \ images \ **ãã§ãã æåŸã«ã¹ã©ãã·ã¥ãä»ããŠããŸãããåŸã§æ確ã«ãªããŸãã
ãã€ãã®ããã«ãæåã«1ã€ã®ãã¡ã€ã«ã§ã¹ã¯ãªããããã¹ãããŸãã ãã®ãããå¥ã®å€æ°fileNameãäœæããŸãããã®å€ã¯ãã img.jpg ããªã©ã®ç¹å®ã®ãã¡ã€ã«åã«ãªããŸãã
ãªã¯ãšã¹ãæ¬æã«æ»ããŸãã [ãªã¯ãšã¹ãã§ãã¡ã€ã«ãéä¿¡]ã»ã¯ã·ã§ã³ã§ããã¹ã次ã®ããã«èšè¿°ããŸãïŒ$ {filePath} $ {fileName}ã æå®ããå€ãå€æ°ïŒãŠãŒã¶ãŒå®çŸ©å€æ°ããã®å€ïŒã«ä»£å ¥ãããšãæ£ãããã¹ãååŸãããŠããããšãç°¡åã«ç¢ºèªã§ããŸãã ãªã¯ãšã¹ããéä¿¡ãããã©ã¡ãŒã¿ãŒãèŠãŠã¿ãŸãããã ãã¡ã€ã«åããããŸãã 代ããã«$ {fileName}ãå ¥åããŠãã ããã
ãã®éšåã®ãŠãŒã¶ãŒã·ãã¥ã¬ãŒã·ã§ã³ãçµäºããã®ã§ãæ°ãããããã°ãµã³ãã©ãŒãè¿œå ããŸãã ããã«äžæ©é²ãã§èããŠã¿ãŸããããã³ã€ã«ãæ°žä¹ ã«å転ããããšïŒèšå®ãããŸã§ïŒãåãŠãŒã¶ãŒã¯äœåºŠãäœåºŠããã°ã€ã³ããŸãã ãããåé¿ããã«ã¯ãOnly Onceããžãã¯ãšã¬ã¡ã³ãïŒ Thread-> Add-> Logic Controllers-> Only Once Controller ïŒãã³ã€ã«ã«è¿œå ããŸãã ãµã€ãäžã®ãŠãŒã¶ãŒã®æ¿èªãæ åœããã¬ã³ãŒãã£ã³ã°ã³ã³ãããŒã©ãŒã®äžã®é©åãªå Žæã«é 眮ããåãšããŠã³ã³ãããŒã©ãŒããã©ãã°ããŸãã
ãã©ãŠã¶ã§ãããã·ãç¡å¹ã«ããŸãã ã¹ã¯ãªãããå®è¡ããŸãã ãã¹ãŠãæ£ããå®äºãããšãéžæããã¢ã«ãã ã«æ°ããåçãè¿œå ãããŸãã äœãåé¡ãããå Žåã¯ãçµæã®è¡šç€ºããªãŒã®ãµã³ãã©ãŒã®ãããã°ãåç §ããŠãã ããã
ãã©ã¡ãŒã¿å
ããã§ããŠãŒã¶ãŒã«ç°ãªãåçãè¿œå ãããããšãã§ããŸãã ãããè¡ãã«ã¯ãåçã®ååã®ã¿ãå«ãcsvãã¡ã€ã«ãäœæããŸãã
Img.jpg
Img1.jpg
Img2.jpg
...
CSVããŒã¿ã»ããæ§æãäœæããå¥ã®CSVããŒã¿ã»ããæ§æã®äžã«ãã©ãã°ããŠããã®ãã¡ã€ã«ãžã®ãã¹ãæå®ããŸãã fileNameãå€æ°ïŒ variable Names ïŒãšããŠæå®ãã User Defined Variablesããåé€ããŸã ã ã»ãã¬ãŒã¿ã®ãã£ãŒã«ãã¯ç©ºçœã®ãŸãŸã«ããŸãã ä»åã¯ããã¡ã€ã«ãæåŸã«å°éãããïŒ EOFã§ãªãµã€ã¯ã« ïŒãã¡ã€ã«ãç¹°ãè¿ããTrueã®ãŸãŸã«ããŠãæåŸã«å°éãããã³ã€ã«ãåæ¢ããŸã ïŒ EOFã§ã¹ã¬ãããåæ¢ ïŒ-Falseã«ããŸãã ãã¹ãã®çŸããããžãã¯ã®ããã«ãåçãå¥ã®ãã©ã«ããŒãDïŒ\ jakarta-jmeter-2.5.1 \ images \ Photo \ãã«è»¢éããããã«å¿ããŠfilePathå€æ°ã®å€ãfilePath_Photoã«å€æŽããŸãã å€æ°ã䜿çšãããå Žæã§ãããè¡ããŸãã
ãã¹ããå®è¡ããŠãã ããïŒ æ¬¡ã«ãã¢ã«ãã ã«3æã®åçãè¿œå ãããŠãããã©ããã確èªããŸãïŒã¯ãããã¹ãŠã®ãŠãŒã¶ãŒãã¢ã«ãã ã«åçãè¿œå ããããã®ååãªæš©éãæã£ãŠããå¿ èŠããããŸãïŒã ãã¹ãŠãåé¡ãªããã°ãç¶è¡ããŸãã ããã§ãªãå Žåã¯ãDebug Samplerããã³ãµãŒããŒã®å¿çããèªã¿ãã ããã
ã¢ãã¿ãŒãå€æŽãã
å®éãããã¯åã®æ®µèœãšå€ãããŸããã åæ§ã«ããµãŒããŒã«åçãã¢ããããŒãããå¿ èŠããããŸãã ãããã£ãŠãç§ãã¡ããã¹ãŠãè¡ããŸãïŒ
- å¥ã®é²é³ã³ã³ãããŒã©ãŒãäœæãã
- ãããã·ãæ§æãã
- ãµã€ãã§ã¢ã¯ã·ã§ã³ãå®è¡ããïŒã¹ã¯ãªãããäœæããïŒ
- ã¹ã¯ãªããããããã«ãã
- 1ã€ã®ã¢ãã¿ãŒã®ãã©ã¡ãŒã¿ãŒå
- ãããã°
- å€ãã®ã¢ãã¿ãŒã®ãã©ã¡ãŒã¿ãŒå
ã¢ãã¿ãŒåãšåãcsvãã¡ã€ã«ã䜿çšããŸããããåçãå¥ã®ãã©ã«ããŒã«ã¢ããããŒããããã®ããã®æ°ããå€æ°filePath_AvatarsãäœæããŸããã
ãã¹ãŠãããŸãããã°ãããã¯è¯ãããšã§ãã ããã§ãªãå Žåã¯ãDebug Samplerãã芧ãã ããã
ã¹ã¯ãªãããçããŠãã人ã®ããã«èŠããããã«ãé 延ãè¿œå ããå¿ èŠããããŸãã ããšãã°ããµãŒããŒã«åçãã¢ããããŒãããåŸããŠãŒã¶ãŒãç»åããµãŒããŒã«ã¢ããããŒããããã®ãåŸ ã£ãŠãããã®ããã«ãäžå®ã®ã¿ã€ããŒã3ç§éïŒ3000msïŒçœ®ãããšãã§ããŸãã ãŸããã¬ãŠã¹ã©ã³ãã ã¿ã€ããŒã®ã¢ãã¿ãŒã2ç§ãã6ç§ã«å€æŽããã«ã¯ããŠãŒã¶ãŒã¯ã¢ãã¿ãŒãæ€çŽ¢ããŠéžæããŸãã ãŸããåHTTPãªã¯ãšã¹ãã®ä¿¡é Œæ§ãé«ããããã«ã[HTMLãã¡ã€ã«ãããã¹ãŠã®åã蟌ã¿ãªãœãŒã¹ãååŸ]ããã¯ã¹ããªã³ã«ããããšãã§ããŸããã€ãŸããéåžžã®ãã©ãŠã¶ãŒãšåæ§ã«ãããŒãžããå¯èœãªãã¹ãŠãèªã¿èŸŒãŸããŸãã
ãããã£ãŠããã¹ãŠãæ£åžžã«æ©èœãããã¹ãŠãæ£åžžã§ãããšããŸãã ããã ãã§ã ã¿ã¹ã¯ã¯å®å šã«å®äºããŸããã ããã§ãäžæ©äžãµã€ããèªã¿èŸŒãããšãã§ããŸãã Threadã«æ»ã£ãŠã foreverãã§ãã¯ããã¯ã¹ãèšå®ããŸãããã ããã¯ããã¹ã¬ããã®åæ¢ãã€ãã³ããçºçãããŸã§ã¹ã¯ãªãããå®è¡ãããããšãæå³ããŸãã CSV Data Set Configã§ã¯ããã®ãããªã€ãã³ãã®å¯èœæ§ãFalseã«èšå®ããŸãã ããã¯ããã¹ã¿ãŒãæã§åæ¢ãããŸã§ãã¹ããå®è¡ãããããšãæå³ããŸãïŒã¡ãã¥ãŒå®è¡->åæ¢ïŒ ã æçµç»é¢ã¯ãèšäºã®åé ã«é 眮ãããŠããŸãã
ãã®ãã¹ãã¯ãããã€ãã®ãœãŒã·ã£ã«ã¡ãã£ã¢ã®ãããµããããžãã¹ããã»ã¹ãã·ãã¥ã¬ãŒãããŸãããŠãŒã¶ãŒã¯æšæ©ã®ããŒãã£ãŒãããªã³ã©ã€ã³ã«è¡ããã¢ã«ãã ã«åçãã¢ããããŒãããŸããã ãã®ãããªããã»ã¹ãæ°žé ã«ç¶ããŠãåçãã¢ããããŒãããŠã¢ãã¿ãŒãå€æŽãã3人ã®ãŠãŒã¶ãŒãç²åŸããŸããã ããã»ã¹ã¯ãä»ã®ããŸããŸãªèŠçŽ ãè¿œå ããããšã§å€æŽã§ããŸãã ããšãã°ãOnly Onceãèšå®ããããšã§1æã®åçã®ã¿ãã¢ããããŒãã§ããŸãããã¢ãã¿ãŒãç¡éã«å€æŽã§ããŸãã æ倧1000人ã®ãŠãŒã¶ãŒã§ããŒã¿ããŒã¹ãè£å ããå Žåã¯ããµãŒããŒãšãªãã£ã¹ã®ããŒã«ã«ãã·ã³ããã¹ã¯ãªãããçŽæ¥å®è¡ããŸããããã¯ãã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã«éåžžã«å€§ããªè² è·ãããããŸãã
次ã®èšäºã§ã¯ãããããæ€çŽ¢ãã¹ããšæ£èŠè¡šçŸããŸãã¯åéãããããŒã¿ã®è©äŸ¡ãšè§£éã«çŠç¹ãåœãŠãŸãã
çµéšã®äº€æãåãã§ããããŸãã