Posted 鍒樺唹鐨勬€濊鲸鎮?/a>
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了相关的知识,希望对你有一定的参考价值。
鏈枃鍙戣〃浜庛€婄▼搴忓憳銆嬫潅蹇?2013 骞?/strong>
馃憖
1锛屾湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿绠€浠?/span>
鏈嶅姟鍣ㄦ€ц兘娴嬭瘯涓昏鏄互娴嬭瘯鏈嶅姟鍣ㄧ殑鎬ц兘涓轰富鐨勬祴璇曟柟娉曪紝閫氳繃妯℃嫙澶氱敤鎴锋寜鐓ч瀹氫箟濂界殑瑙勫垯瀵规湇鍔″櫒杩涜骞惰璁块棶锛岀洃娴嬪苟璁板綍鏈嶅姟鍣ㄧ殑 Response Time锛孴hroughput锛?Server Hits 浠ュ強 Memory 鍜?CPU 绛夊疄鏃舵暟鎹紝閫氳繃鍒嗘瀽娴嬭瘯鏁版嵁锛屽緱鍒版湇鍔″櫒鐨勫悇椤规€ц兘鎸囨爣浠庤€屽彂鐜版湇鍔″櫒鐨勬€ц兘鐡堕鍜屽唴瀛樻硠婕忕瓑闂銆傝繘琛岃繖鏍锋祴璇曠殑宸ュ叿绉颁箣涓烘湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿銆?/span>
鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿閫氳繃澶氬勾鐨勫彂灞曪紝宸茬粡浠?ab锛廰bs 杩欑绠€鍗曠殑鍛戒护琛屽伐鍏峰彂灞曞埌鏈変赴瀵?UI 閰嶇疆鐣岄潰鐨?Jmeter锛孡oadRunner锛屽埌鐜板湪鐨?Gatling 鏀寔 DSL/Actor, LoadUI 鏀寔鍥惧舰鍖栫綉缁滄帴鍙g殑鏂颁竴浠e伐鍏凤紝 鍙互璇存槸绉嶇被绻佸銆傚浜庡悇绉嶄笉鍚岀殑闇€姹傦紝搴旇閮借兘鎵惧埌涓€娆剧浉瀵瑰悎閫傜殑宸ュ叿銆傚鏋滃彧鏄兂鍋氬叆闂ㄧ骇鍒殑鍘嬪姏娴嬭瘯锛屾瘮濡傚彧鏄渶瑕佺畝鍗曠殑浜х敓璁稿 HTTP 璇锋眰锛岄偅涔?ab 鍜?curl-loader 灏辫兘瀹屾垚宸ヤ綔锛涘鏋滈渶瑕佸湪鏈夐檺鐨勮澶囦笂杩涜鏈€澶у己搴︾殑鍙戝寘锛岄偅涔?Gatling 鍜?Locust 灏嗘槸涓嶄簩閫夋嫨锛涘鏋滆祫閲戝厖瑁?鍟嗙敤鐨?LoadRunner 鍜?LoadUI Pro 缁濆鑳芥弧瓒抽渶姹傦紱濡傛灉浣犳槸 Windows 鐨勫繝瀹炴嫢鎶よ€咃紝閭d箞 OpenSTA 鍜?WebLoad 涔熸槸寰堝ソ鐨勯€夋嫨锛涘鏋滀綘骞朵笉鏄枩娆㈢紪绋嬪拰淇敼 xml锛屽苟涓旇祫閲戜篃涓嶅厖瑁曪紝閭d箞 Jmeter 鍜?LoadUI 鏄笉閿欑殑閫夐」锛涘鏋滀綘鏄?Python 鐖卞ソ鑰咃紝閭d箞 Locust 鍜?Grinder 灏嗗彲浠ュ欢缁綘鐨勭埍濂姐€?/span>
鎬讳箣锛屾瘡涓伐鍏烽兘鏈夎嚜宸辩殑浼樼偣鍜岀己鐐癸紝鍙鏍规嵁闇€姹備互鍙婅祫閲戞儏鍐甸€夋嫨鍚堥€傜殑宸ュ叿灏卞彲浠ヤ簡銆傚洜涓烘瘡涓伐鍏风殑鍩烘湰鍔熻兘閮芥槸浜х敓灏藉彲鑳藉鐨勭綉缁滆姹傦紝鐒跺悗鏀堕泦鍚勭鏁版嵁骞跺睍鐜板嚭鏉ャ€傚彧涓嶈繃鐢变簬浣跨敤鐨勬妧鏈笉鍚屼互鍙婂紑鍙戣€呯殑鐩爣涓嶅悓锛屾墍浠ュ緱鍒扮殑鏁堟灉涓嶄竴鏍疯€屽凡锛堣瑙佺浜岃妭 锛夈€?/span>
馃憖
2锛屼富瑕佺殑鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿
瀵逛簬鐜板湪宸叉湁鐨勬湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿濡傛灉鎸夌収琛ㄧ幇妯″紡锛屼富瑕佸彲浠ュ垎涓哄懡浠ゆā寮忥紝鍥惧舰妯″紡锛岃剼鏈ā寮忋€備笅闈㈠氨瀵逛竴浜涗富瑕佺殑宸ュ叿杩涜涓€涓嬩粙缁嶃€?/span>
鍛戒护妯″紡锛?/strong>
ab锛廰bs锛歛b锛廰bs 鏄?Apache Http Server 鑷甫鐨勪竴娆剧殑鎬ц兘娴嬭瘯宸ュ叿锛屽畨瑁呬簡 Apache 灏卞彲浠ュ湪鍏剁洰褰曚笅闈㈡壘鍒板畠銆傚畠鍏锋湁浣撶Н灏忥紝鎬ц兘楂樼殑鐗圭偣锛岀己鐐规槸娌℃湁鐣岄潰锛屾姤琛ㄧ畝鍗曪紝寰堥毦浣跨敤鍏惰繘琛屽鏉傛祦绋嬬殑鎬ц兘娴嬭瘯锛屽繀椤诲€熷姪绗笁鏂硅瑷€鐨勫府鍔╋紝姣斿 Bash Shell锛孭ython 绛夈€?/span>
curl-loader锛歝url-loader 鏄竴娆惧熀浜?c 寮€鍙戠殑鍛戒护琛屽伐鍏凤紝鎷ユ湁鍜?ab锛廰bs 涓€鏍风殑鐗圭偣锛屼絾鏄敮鎸佹洿澶氱殑鍔熻兘锛屾瘮濡?FTP 鍜?TLS/SSL 鍗忚鏍堬紝鏀寔鐢ㄦ埛璁よ瘉鍜岀櫥闄嗭紝鎷ユ湁鏇村ソ鐨勬姤琛ㄧ郴缁熴€傛墍浠ュ鏋滄兂瑕佷竴涓姛鑳藉姞寮虹増鐨?ab锛廰bs锛岄偅灏遍€夋嫨 curl-loader銆?/span>
鍥惧舰妯″紡锛?/strong>
LoadUI锛歀oadUI 鏄竴娆惧紑婧愬厤璐圭殑鎬ц兘娴嬭瘯宸ュ叿銆傚畠闄や簡鎷ユ湁鍜屽叾浠栨€ц兘娴嬭瘯宸ュ叿涓€鏍风殑鍔熻兘浠ュ锛岃繕鍏锋湁涓€涓緢鏈夊垱鎰忕殑鐗规€э細鍥惧舰鍖栫綉缁滄帴鍙o紝鍗虫嫋鍗虫斁鍗充娇鐢ㄣ€傝繖涓壒鎬т娇寰楀彲浠ラ€氳繃鎷栨斁缃戠粶鎺ュ彛缁勪欢鏉ョ粍鎴愮殑缃戠粶鎷撴墤鍥撅紝鐒跺悗鍩轰簬杩欎釜鎷撴墤鍥捐繘琛屾€ц兘娴嬭瘯锛屼互鍙婃鏌ュ拰瑙傚療娴嬭瘯鎯呭喌銆傚畠鍩烘湰涓婃敮鎸佹墍鏈夋爣鍑嗗崗璁紝姣斿 HTTP(S), HTML, SOAP/WSDL 鍜?REST to AMF, JDBC, and POX銆備綔涓哄叆闂ㄧ骇鍒殑娴嬭瘯宸ュ叿鎴栬€呯粌涔狅紝瀹冪粷瀵规槸涓€娆惧緢涓嶉敊鐨勫伐鍏枫€?/span>
LoadUI Pro锛歀oadUI Pro 鏄熀浜?LoadUI 澧炲己鍔熻兘鐨勬敹璐圭増锛屽叾鏇翠负寮哄ぇ鐨勫姛鑳界粷瀵圭墿瓒呮墍鍊硷紝璇︾粏姣旇緝璇疯锛?/span>http://www.loadui.org/About-loadUI/compare-loadui-and-loadui-pro.html锛夈€傝櫧鐒?LoadUI 浠锋牸涔熶笉渚垮疁锛屼絾鏄拰 LoadRunner 姣斿氨渚垮疁寰堝浜?(http://www.loadui.org/About-loadUI/compare-loadui-and-loadui-pro.html锛?/span>銆傝櫧鐒?LoadUI 浠锋牸涔熶笉渚垮疁锛屼絾鏄拰 LoadRunner 姣斿氨渚垮疁寰堝浜?銆?/span>
LoadRunner锛歀oadRunner 鍙互绠椾笟鐣屾渶鍑哄悕锛屼篃鏄姛鑳芥渶涓哄己澶х殑鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿锛屽綋鐒朵环鏍间篃鍗佸垎鏄傝吹銆傚畠鏄?2006 骞?HP 浠?Mercury Interactive 璐拱杩囨潵鐨勪骇鍝併€傚畠鍙互妯℃嫙鍚勭鎬ц兘娴嬭瘯琛屼负锛屾敮鎸佺殑鍗忚涔熷崄鍒嗕紬澶氾紝姣斿 Flex AMF, Citrix ICA, Remote Desktop Protocol (RDP), ERP/CRM (e.g. SAP, Oracle eBusiness, Siebel and PeopleSoft), Databases, Mail Clients, Web Services 绛夈€傚鏋滆祫閲戝厖瑁曪紝閫夋嫨瀹冨簲璇ヨ兘婊¤冻缁濆ぇ閮ㄥ垎闇€姹傦紝涓嶈繃鍏舵€т环姣旂‘瀹炴槸涓€涓笉澶т笉灏忕殑闂銆?/span>
Apache Jmeter锛欰pache Jmeter 鏄幇鍦ㄦ渶娴佽鐨勫厤璐规湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿涔嬩竴銆傚畠鏄竴涓?100%绾?java 寮€鍙戠殑搴旂敤绋嬪簭锛屽叾鍥惧舰鐣岄潰鐨勬槗鐢ㄦ€у彲浠ュ拰 LoadRunner 鐩告彁骞惰锛屽叾涓板瘜鐨勬彃浠舵彁渚涗簡鍚勭鍗忚鐨勬敮鎸侊紝涓板瘜鐨勬祴璇曟姤琛紝鎵╁睍缁勪欢 BSF 鏀寔鍚勭璇█鐨勬墿灞曪紝姣斿 JavaScrip锛孯uby锛孭ython 绛夛紝浠ュ強鏀寔鍒嗗竷寮忕瓑鍚勭鍏堣繘鐨勭壒鎬с€傚綋鐒?Jmeter 涔熶笉鏄畬缇庣殑锛屽畠涔熷瓨鍦ㄤ竴浜涗笉瓒炽€備笉杩囧浜庢湇鍔″櫒鎬ц兘娴嬭瘯鍏ラ棬浠ュ強娌℃湁寰堝ソ鐨勬妧鏈偍澶囧苟涓旇祫閲戜笉鍏呰鐨勫叕鍙告潵璁诧紝Jmeter 灏嗘槸涓€涓畬缇庣殑閫夋嫨銆?/span>
鑴氭湰妯″紡锛?/strong>
Tsung锛歍sung 鏄竴娆惧熀浜?Erlang 寮€鍙戠殑楂樻€ц兘鍏嶈垂鐨勬湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿锛屽畠鍏锋湁鍒嗗竷寮忥紝褰曞埗鑴氭湰锛屽浘褰㈡姤琛ㄧ郴缁熺瓑鍔熻兘锛屽崗璁柟闈㈡敮鎸?HTTP锛孲OAP锛屽拰 Jabber Server锛圫SL锛夌瓑銆傚叾娴嬭瘯鑴氭湰鏄€氳繃 XML 鏉ヨ繘琛屾弿杩扮殑銆傜敱浜庢病鏈夊浘褰㈢鐞嗙晫闈紝鎵€浠ョ紪鍐欏拰缁存姢娴嬭瘯鑴氭湰灏嗕細鏄竴涓笉灏忕殑鍥伴毦銆傚鏋滆瀵瑰叾杩涜鎵╁睍锛屼篃闇€瑕侀€氳繃 Erlang銆傞櫎闈炲叕鍙告湁 Erlang 鐨勬妧鏈汉鍛橈紝涓嶇劧灏变笉瑕佽交鏄撻€夋嫨鍏朵綔涓轰富瑕佺殑娴嬭瘯宸ュ叿銆?/span>
Grinder锛欸rinder 鏄竴涓熀浜?Java 寮€鍙戯紝閫氳繃 Jython锛堟渶鏂扮増澧炲姞浜?Clojure 鐨勬敮鎸侊級椹卞姩鐨?Load-Testing 妗嗘灦銆傜敱浜庡彲浠ラ€氳繃缂栧啓 Jython 鑴氭湰鏉ュ疄鐜版祴璇曟渚嬶紝浠庤€岃幏寰椾簡涓€浜涘枩娆?Python 鐨勬妧鏈汉鍛樼殑鍠滅埍銆備笉杩囩敱浜?Jython 鏈韩鐨勪竴浜涢棶棰橈紝涔熼€犳垚浜?Grinder 浼氬嚭鐜板唴瀛樻硠婕忥紝涓嶇ǔ瀹氱瓑鎯呭喌銆傛墍浠ュ浜庡皬瑙勬ā鎬ц兘娴嬭瘯骞朵笖鎷ユ湁寰堝ソ鐨?Python 鎶€鏈汉鍛樺偍澶囩殑鍏徃锛岃繕鏄彲浠ラ€夋嫨 Grinder 杩涜灏濊瘯銆?/span>
Locust: Locust 鏄竴涓熀浜?Python 寮€鍙戯紝骞朵笖閫氳繃缂栧啓 ython 鑴氭湰鏉ュ疄鐜版祴璇曞満鏅€傚畠閫氳繃寮傛浜嬩欢妯″瀷杈惧彲浠ュ疄鐜伴珮骞跺彂璇锋眰锛屽悓鏃跺畠杩樻敮鎸佸垎甯冨紡妯″瀷锛屼粠鑰屽彲浠ユ墿灞曞苟瀹炵幇瓒呴珮骞跺彂璇锋眰銆傚鏋滄€ц兘鏈夊緢楂樼殑瑕佹眰锛屽苟涓旀嫢鏈夊緢濂界殑 Python 鎶€鏈汉鍛橈紝鍙互閫夋嫨 Locust 杩涜鎬ц兘娴嬭瘯銆?/span>
Gatling锛欸atling 鏄渶杩戞墠鍑虹幇鐨勬柊涓€浠f湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿锛屽畠鍏锋湁楂樻€ц兘锛岃交閲忚〃鎶ワ紝浠ュ強 DSL 鑴氭湰鐨勭壒鎬с€傚鏋滄兂瑕佽幏寰楀拰 Tsung 涓€鏍锋垨鑰呮洿濂界殑鎬ц兘锛屽鏋滃笇鏈涙敮鎸佺畝鍗曟槗璇荤殑 DSL 鑴氭湰骞朵笖甯屾湜鑳藉湪 IntelliJ 鏈夋彃浠剁殑鏀寔锛屽鏋滄兂瑕佽交閲忔姤琛ㄧ郴缁燂紝閭d箞 Gatling 鏄敮涓€閫夋嫨銆?/span>
濡傛灉璧勯噾鍏呰锛?璐拱鍟嗙敤鐨勬祴璇曞伐鍏锋槸寰堝ソ鐨勯€夋嫨锛屼絾鏄鏋滃彧鏄竴涓垱涓氬叕鍙告垨鑰呭苟涓嶆兂鍦ㄦ湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿涓婂仛澶鐨勬姇璧勶紝閭d箞绗笁鑺傜殑鍐呭涔熻鑳芥彁渚涗竴浜涘府鍔┿€?/span>
馃憖
3锛屼笁涓湡瀹為」鐩腑鎬ц兘娴嬭瘯宸ュ叿瀹炴垬
1, 鍦ㄤ竴涓?Erlang 寮€鍙戠殑鐢典俊璁¤垂绯荤粺涓粠 Tsung 杞悜 Jmeter
鎴戞浘鍙傚姞杩囦竴涓數淇¤璐圭郴缁熼」鐩殑娴嬭瘯宸ヤ綔锛岃繖涓」鐩浜?90 骞翠唬锛岄偅涓椂鍊?Java 鍒氬垰璧锋锛屽浜庡苟鍙戞€ц兘鍜屽閿欒姹傚崄鍒嗕弗鏍肩殑鐢典俊绯荤粺鏉ヨ锛孍rlang 鍑犱箮鏄敮涓€閫夋嫨銆備絾鏄敱浜庡叕鍙歌妯¤緝灏忥紝鎵€浠ヤ篃娌℃湁澶鐨勯绠楀幓璐拱鍟嗙敤鐨勬€ц兘娴嬭瘯宸ュ叿锛?鎵€浠ュ彧鏄畝鍗曠殑灏嗗崟鍏冩祴璇曟敼瑁呬竴涓嬭繘琛屽苟鍙戣皟鐢紙姣斿璋冪敤涓€涓嚱鏁?1 涓囨锛夋潵鍋氭€ц兘娴嬭瘯銆傝繖鏍风殑鐩殑浠呬粎鍙槸妫€鏌ュ嚱鏁拌骞跺彂璋冪敤鐨勬椂鍊欎細涓嶄細鍑虹幇涓€浜涢棶棰橈紝鑰屾棤娉曟祴璇曠湡瀹炵殑鍦烘櫙銆傝繘琛屽埌椤圭洰涓湡鐨勬椂鍊欙紝鎴戜滑鍙戠幇杩欐牱鐨勬祴璇曞叾瀹炲苟涓嶈兘鍙戠幇涓€浜涘満鏅腑鐨勬€ц兘闂锛屾墍浠ュ紑濮嬪鎵句竴涓伐鍏峰彲浠ュ熀浜庡満鏅潪鍗曞厓鑰岃繘琛屾€ц兘娴嬭瘯銆傜敱浜庨」鐩殑寮€鍙戜汉鍛橀兘鍗佸垎鐔熸倝 Erlang锛屼篃鏄熀浜?Erlang 浼樼鐨勫苟鍙戞€э紝鎵€浠ラ€夋嫨浜嗙敤 Erlang 寮€鍙戠殑 Tsung銆傝櫧鐒?Tsung 鏀寔褰曞埗鍔熻兘锛岀敱浜庡畠鐨勬祴璇曡剼姝ラ兘鏄熀浜?XML锛屼慨鏀逛篃闇€瑕佺洿鎺ヤ慨鏀?XML锛屾墍浠ュ湪浣跨敤杩囩▼涓彂鐜板浜庢祦绋嬫瘮杈冨鏉傜殑娴嬭瘯妗堜緥锛屽苟涓旀祦绋嬮渶瑕佸彉鍖栫殑鏃跺€欏娴嬭瘯鑴氭湰鐨勫紑鍙戝拰缁存姢鍗佸垎楹荤儲銆傚湪 Debug 娴嬭瘯鑴氭湰鐨勬椂鍊欐棤娉曞姩鎬佹樉绀烘姤琛ㄨ€屽彧鑳界湅鏃ュ織锛屾墍浠ユ渶缁堟垜浠喅瀹氭姏寮?Tsung 鑰屼娇鐢?Jmeter銆?/span>
閫夌敤 Jmeter 涓昏鏄熀浜庡叾寮€鍙戝拰缁存姢鐨勫ぇ閮ㄥ垎宸ヤ綔鍙渶瑕佸湪鐣岄潰涓婂 Test Plan 杩涜閰嶇疆锛岀劧鍚庡彲浠ラ€氳繃 BSF 杩涜灏戦噺鐨勮剼鏈紑鍙戝氨鑳藉紑鍙戝鏉傜殑娴嬭瘯妗堜緥銆傛垜浠殑鍏蜂綋寮€鍙戞祦绋嬫槸棣栧厛閫氳繃鐣岄潰閰嶇疆骞跺彂绾跨▼鐨勮鍒欎互鍙婁富瑕佺殑娴嬭瘯娴佺▼锛岀劧鍚庡浜庢煇浜涙湁鐗规畩瑕佹眰鐨勬祴璇曟渚嬬紪鍐?Ruby 鑴氭湰骞跺皝瑁呭湪 BSF Sampler 涓紝姣斿瀵圭粨鏋滆繘琛岀壒瀹氬垎鏋愶紝澶勭悊鐒跺悗瀛樺偍鍒版暟鎹簱鎴栬€呮枃浠剁瓑鐗规畩闇€姹傘€傜敱浜?BSF 鏀寔鍑犱箮鎵€鏈夊彲浠ュ湪 JVM 涓婅繍琛岀殑璇█锛屾瘮濡?Jython锛孞Ruby锛孞avascript 绛夛紝鎵€浠ュ彲浠ラ€夋嫨鐔熸倝鐨勮瑷€缂栧啓杩欑鐗规畩闇€姹傜殑娴嬭瘯鎵╁睍銆?/span>
褰撶劧 Jmeter 涔熶笉鏄畬缇庣殑锛屽洜涓轰娇鐢ㄨ繃绋嬩腑鎴戜滑涔熼亣鍒颁竴浜涢棶棰橈細
閫氳繃鐣岄潰鏂瑰紡杩愯 Test Plan 鐨勬椂鍊欙紝濡傛灉绾跨▼杩囧锛屾瘮濡傝秴杩?1000-2000 涓嚎绋嬶紙鍦ㄦ垜浠」鐩壒瀹氱殑纭欢鐜涓嬶級锛岄偅涔堢晫闈互鍙?Listener 閲岄潰鐨勫浘琛ㄤ細鍑虹幇姝诲睆鐨勬儏鍐点€傛墍浠ュ紑鍙戝拰璋冭瘯鐨勬椂鍊欓渶瑕佹妸绾跨▼璁剧疆鍒?1000 浠ヤ笅鏈€濂斤紝鎴栬€呴€氳繃鍛戒护琛屾棤鐣岄潰鐨勬柟寮忚繘琛屾祴璇曘€?/span>
鐢变簬 Jmeter 鏄熀浜?Java Thread 鐨勬ā鍨嬪紑鍙戠殑锛屽苟娌℃湁 Tsung 杩欑鍩轰簬 Actor 妯″瀷鐨勬晥鐜囬珮锛屾墍浠ユ垜浠€夌敤浜?Cluster 鐨勬ā鍨嬭繘琛屾祴璇曘€備絾鏄彂鐜板綋 Node 杩囧锛屼粠 Node 浼犲悜 Server 鐨勬暟鎹篃浼氳窡 Node 鐨勪釜鏁版垚绾挎€у闀匡紝浣嗘槸鑳借揪鍒扮殑骞跺彂璇锋眰鍗翠笉鑳芥垚绛夋瘮绾挎€у闀匡紝瑕佷綆浜庣悊璁哄€煎緢澶氾紝鎵€浠ュ纭欢璧勬簮鐨勬氮璐逛篃鏄瘮杈冨ぇ鐨勩€?/span>
濡傛灉璁剧疆鐨勭嚎绋嬪お澶氾紝寰堝鏄撳嚭鐜?OOM锛屾墍浠ユ垜浠竴鑸渶楂樺崟鏈鸿缃笉浼氳秴杩?2000 涓?Thread 瀵逛簬绠€鍗曠殑娴嬭瘯妗堜緥銆?/span>
濡傛灉杩涜 Soak Testing 瓒呰繃 1 澶╋紝骞朵笖 Result 閲囩敤 XML 鐨勬牸寮忓瓨鍌紝鍏剁粨鏋滄枃浠跺ぇ灏忎細杈惧埌鍑犱釜 G 鐢氳嚦 10 澶氫釜 G銆傚鏋?Result 鏀逛负 CSV 鏍煎紡瀛樺偍锛屽叾澶у皬涔熸湁鍑犵櫨鍏嗭紝濡傛灉 Testing 瓒呰繃 1 鍛紝閭d箞鏁版嵁涔熸槸宸ㄥぇ鐨勩€傛墦寮€杩欎釜宸ㄥぇ鐨?Result 鏂囦欢鏌ョ湅鍚勭 Listener 鍥捐〃闇€瑕佸緢闀挎椂闂达紝鏄竴浠跺崄鍒嗙棝鑻︾殑浜嬫儏锛屽鏋滃お澶ц繕浼氬嚭鐜?OOM銆?/span>
2, 鍦ㄤ竴涓?J2EE 寮€鍙戠殑 Social Network 椤圭洰涓粠 Grinder 杞悜 Jmeter
21 涓栫邯寮€濮嬬殑 10 骞存槸灞炰簬绀句氦缃戠粶鐨?10 骞达紝鍏ㄤ笘鐣岀殑绀句氦缃戠粶濡傞洦鍚庢槬绗嬭埇涓€涓嬪瓙閮芥秾鐜板嚭鏉ャ€傛垜浠叕鍙镐篃鏄叾涓竴绗嬶紝寮€鍙戜簡涓€娆剧ぞ浜ょ綉缁滅郴缁熴€傚浜庣ぞ浜ょ綉缁滅郴缁燂紝鍏跺苟鍙戞€ц兘鍜屽閿欑殑瑕佹眰涓€鐐逛篃涓嶄簹浜庣數淇¤璐圭郴缁熴€傜敱浜庡紑鍙戞绯荤粺鐨勬椂鍊欐鏄剼鏈紑鍙戞椂浠o紝鎵€浠ョ郴缁熺殑鏋舵瀯甯堥€夋嫨浜嗗熀浜?Python 寮€鍙戠殑 Grinder 鏉ュ仛鎬ц兘娴嬭瘯銆傜敱浜?Grinder 闇€瑕佺紪鍐?Jython 鑴氭湰锛屽苟涓旂敱浜庨」鐩紑鍙戣繘搴︾殑闂锛屽彧鏄紑鍙戜簡鍩烘湰鍦烘櫙鐨?Performance Testing锛?Load Testing锛孲oak Testing銆傚熀浜庤繖浜涘満鏅垜浠紑濮嬪鎵剧郴缁熺殑澶勭悊鏋侀檺锛屾槸鍚﹀瓨鍦ㄥ唴瀛樻硠婕忕瓑闂锛屾牴鏈病鏈夋椂闂村幓鍋氭瘮杈冨鏉傛祴璇?銆傚湪鍋?Soak Testing 鐨勬椂鍊欐垜浠繕璇佸疄浜?Grinder 瀛樺湪鐨勫唴瀛樻硠婕忛棶棰橈紝鏈€缁堣繖涓€鍒囦笉寰椾笉浣挎垜浠姏寮冧簡 Grinder 鑰岄€夋嫨 Jmeter銆?/span>
鍦ㄨ繖涓」鐩噷闈㈡垜浠皾璇曚簡鍘婚€氳繃灏?Server 閮ㄧ讲鍦?VM Node 涓婏紝浠庤€屼娇鍏跺湪浣庨厤缃殑纭欢璁惧涓婅繍琛屻€傝繖鏍烽€氳繃 Jmeter 灏变笉闇€瑕佷骇鐢熷ぇ瑙勬ā鐨勫苟鍙戣姹傦紝灏卞彲浠ユ瘮杈冨鏄撶殑杈惧埌 Server 鐨勮闂瀬闄愶紝浠庤€岃閬?Jmeter 鐨勬€ц兘闂銆傚綋鐒惰繖绉嶆柟娉曞苟涓嶆槸涓€绉嶅畬缇庣殑瑙e喅鏂规锛屼篃瀛樺湪鍏堕棶棰橈紝姣斿鏃犳硶鐪熷疄妯℃嫙鐜板疄鎯呭喌銆備絾鏄敱浜庨儴缃插拰浜у搧鐜涓€鏍风殑纭欢杩涜娴嬭瘯锛屾湰韬‖浠舵垚鏈氨鍗佸垎鐨勯珮銆傚埄鐢ㄨ繖绉嶆柟妗堬紝涓嶄粎鍑忓皯浜嗗叕鍙稿娴嬭瘯鐜鐨勭‖浠舵姇鍏ワ紝杩樺噺灏戜簡涓€瀹氳蒋浠舵垚鏈紝姣斿閰嶇疆鍜岀淮鎶?Jmeter Cluster銆傛渶鍚庨€氳繃 CI 杩涜娴嬭瘯鏃跺€欙紝涔熷噺灏戜簡 CI 鐨勯厤缃拰缁存姢鎴愭湰銆?/span>
3, 鍦ㄤ竴涓紑鍙戠殑 J2EE 鐨勫晢涓氱郴缁熶腑灏濊瘯浣跨敤鏂颁竴浠e伐鍏?Gatling
鏈€杩戞鍦ㄥ紑鍙戜竴涓熀浜?J2EE 鐨勫晢涓氱郴缁燂紝鍏朵笟鍔¢€昏緫姣旇緝澶嶆潅锛?浣嗘槸瀵瑰苟鍙戞€ц兘瑕佹眰骞朵笉鍗佸垎楂橈紝鎵€浠ヤ粠椤圭洰寮€濮嬪氨閫夋嫨浜?Jmeter 浣滀负鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿銆傛垜浠熀浜?Jmeter 寮€鍙戜簡鍚勪釜鍦烘櫙涓嬬殑 Test Plan锛屽苟閫氳繃 Jenkins 杩涜娴嬭瘯銆傜敱浜庢祴璇曞満鏅瘮杈冨鏉傦紝鎵€浠?Test Plan 閲岄潰鐨?Sampler, Assertion 绛変篃寰堝锛岃繍琛屾椂鍗犵敤鐨勫唴瀛樹篃姣旇緝澶氾紝鏁版嵁浜や簰涔熸瘮杈冨锛屽瓨鍌ㄧ殑 Result 涔熸瘮杈冨ぇ銆傞壌浜庢垜浠箣鍓嶉」鐩殑缁忛獙锛孞meter 骞朵笉閫傚悎鍋氳繖鏍烽」鐩殑 Soak Testing銆?/span>
骞歌繍鐨勬槸 Gatling 鐨勫嚭鐜板垰濂借兘瑙e喅杩欐牱鐨勯棶棰樸€侴atling 鏄熀浜?Scala 鍜?Akka 寮€鍙戠殑鏂颁竴浠f湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿锛屽畠浣跨敤鐨?Actor 鍜屽紓姝?IO 浣垮叾鍦ㄥ苟鍙戞€ц兘鏂归潰杩滆繙瓒呰秺浜?Jmeter锛屽畠鐨勬姤琛ㄧ郴缁熸槸 HTML 鏂囦欢鏉ュ瓨鍌ㄧ殑骞堕厤鏈変赴瀵岀殑鍔ㄦ€佸浘琛紝鎵€浠ュ畠鐨勯珮鎬ц兘鍜岃交閲忔姤琛ㄧ郴缁熷垰濂藉讥琛ヤ簡 Jmeter 鍦?Soak Testing 鍜屽崟鏈洪珮鎬ц兘鏂归潰涓嶈冻鐨勯棶棰樸€?/span>
Gatling 杩樺叿鏈変互涓嬬壒鎬э細
鏀寔 DSL锛屼娇寰楁祴璇曡剼鏈洿涓虹畝鏄庡拰鏇村ソ鐨勫彲璇绘€?/span>
鏀寔杞婚噺鍜屽姩鎬侀〉闈㈢殑 HTML 娴嬭瘯鎶ヨ〃
鏀寔褰曞埗骞剁洿鎺ョ敓鎴愭祴璇曡剼鏈?/span>
鏀寔 Maven 鎻掍欢锛屽彲浠ュ緢濂界殑鍜?Eclipse锛廔ntelliJ 绛?IDE 杩涜闆嗘垚
鏀寔 Jenkins 鎻掍欢
鏀寔 Debian Package锛屾墍浠ュ甫 Debian 鍜?Ubuntu 涓嬮潰鍙互閫氳繃 apt-get 杩涜蹇€熷畨瑁呭拰浣跨敤
鐜板湪鎴戝凡缁忓紑濮嬭€冭檻灏濊瘯鐢?Gatling 閲嶅啓涓€閮ㄥ垎娴嬭瘯妗堜緥鏉ヨ繘琛?Soak Testing锛屼粠鑰屽皢椤圭洰甯﹀叆 Gatling 鏃朵唬銆?/span>
Gatling 涔熶笉鏄畬缇庣殑锛屽畠鍙戝竷鐨勬椂闂翠篃涓嶉暱锛屽綋鐒朵篃瀛樺湪涓€浜涗笉瓒筹紝璇﹁涓嬭妭銆?/span>
馃憖
4锛屾湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿鐨勫彂灞曞拰璁炬兂
铏界劧鐜板湪宸叉湁鐨勫悇绉嶅厤璐规湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿宸茬粡鎷ユ湁浜嗗崄鍒嗕赴瀵岀殑鍔熻兘锛屼絾鏄粛鏈変竴浜涢渶瑕佹敼杩涘拰鍔犲己鐨勫湴鏂广€?/span>
鏇翠负寮哄ぇ鐨?Server Monitor: 铏界劧 Jmeter 鐨?Plugin 宸茬粡瀹炵幇浜?Server Monitor锛屾垨鑰呬篃鍙互閫氳繃绗笁鏂瑰伐鍏锋瘮濡?OpenTSDB 杩涜 Server Monitor锛屼絾鏄湡姝d娇鐢ㄨ捣鏉ヨ繕鏄緢涓嶆柟渚裤€傛瘮濡傚湪绗簩涓疄鎴橀」鐩腑锛屾垜浠氨鏄嚜宸遍€氳繃 Python 鑴氭湰鏀堕泦 Server 鐨?JMX 淇℃伅锛岀劧鍚庝紶閫掔粰 OpenTSDB锛屽垎鏋愭暟鎹殑鏃跺€欓渶瑕佹牴鎹椂闂磋酱鍒嗗埆鏌ョ湅 Jmeter 鍜?OpenTSDB 鐨勫浘琛ㄣ€傚鏋滆兘鎶婃敹闆嗗拰鏄剧ず JMX 绛夎繖绫?Server 绯荤粺鍐呴儴淇℃伅鐨勫姛鑳介泦鎴愬叆娴嬭瘯宸ュ叿锛岄偅涔堝氨鍙互鍦ㄥ悓涓€涓姤琛ㄧ郴缁熼噷闈㈡煡鐪?Client 绔拰 Server 绯荤粺鍐呴儴鍚勭淇℃伅锛屼粠鑰屾洿绠€鍗曠殑杩涜娴嬭瘯鏁版嵁鍒嗘瀽銆?/span>
鏇村ソ鐨?CI 鏀寔锛氱幇鍦ㄦ渶娴佽鐨勫厤璐?CI锛岼enkins/Hudson 铏界劧鏈夋彃浠舵敮鎸?Jmeter 绛夊伐鍏凤紝浣嗘槸浠呬粎鏄樉绀轰竴涓嬫眹鎬绘暟鎹紝骞朵笉鑳藉皢鍚勭鎶ヨ〃鍜岃缁嗘暟鎹樉绀哄埌 CI 涓娿€傚鏋?CI 涓婅兘鐩存帴鏄剧ず鐢氳嚦鑷畾涔夊悇绉嶆暟鎹姤琛ㄤ互鍙婂疄鏃舵樉绀烘暟鎹姤琛紝閭d箞灏嗗彲浠ユ瀬澶х殑鏂逛究鐨勬棩甯告祴璇曞伐浣滐紝骞跺姞蹇祴璇曞垎鏋愬拰娴嬭瘯鏁版嵁姹囨€汇€?/span>
Jmeter 鐨勬湭鏉ワ細Jmeter 瀵逛簬涓嶄細鍐欎唬鐮佺殑娴嬭瘯浜哄憳灏辨槸涓€涓ぉ浣匡紝浣嗘槸鐢变簬鍏舵€ц兘鍜屾姤琛ㄩ棶棰橈紝寰€寰€涓嶈兘鍦ㄦ湁闄愮殑璁惧涓婂彂鎸ョ‖浠剁殑鏈€澶ц兘鍔涖€傛墍浠ュ鏋滆兘鐢?Actor 鏇挎崲鎺?Thread锛岃鍏惰兘鍏呭垎鍙戞尌纭欢鐨勬€ц兘锛屽苟涓旇兘鏈夎交閲忕骇鐨勬姤琛ㄧ郴缁燂紝姣斿鐩存帴鍙互灏?Report 瀛樺偍鎴愪负 HTML 鏂囦欢锛岄偅涔?Jmeter 灏嗕細杩庢潵鍙﹀涓€涓槬澶┿€?/span>
Gatling 鐨勬湭鏉ワ細Gatling 鏄渶鏂颁竴浠f湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿锛屽畠涓嶄粎鏈夊嚭鑹茬殑鎬ц兘锛岃€屼笖鑰屼笖杩樻敮鎸?DSL 鍜?Scala 鑴氭湰寮€鍙戯紙Scala 鍙互涓嶉渶瑕佺紪璇戣€屼互鑴氭湰鐨勬柟寮忔墽琛岋級銆備絾鏄畠鐜板湪涓嶆敮鎸佸垎甯冨紡涔熺畻鏄畠鐨勪竴涓笉澶т笉灏忕殑闂锛屾墍浠ュ鏋滄湭鏉?Gatling 鏀寔鍒嗗竷寮忓苟鏀寔鏇村绉嶇被鐨勬姤琛ㄥ拰鍗忚锛岄偅涔堝畠寰堟湁鍙兘鍦ㄦ湭鏉ョ殑鍏嶈垂鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿甯傚満涓婂崰鎹富瀵煎湴浣嶃€?/span>
鎬荤殑璇存潵锛岀幇鍦ㄥ凡鏈夌殑鏈嶅姟鍣ㄦ€ц兘娴嬭瘯宸ュ叿鍩烘湰涓婇兘鑳芥弧瓒冲熀鏈殑涓氬姟闇€姹傦紝鍙笉杩囨牴鎹嚜宸辩殑鎶€鏈兘鍔涘拰涓氬姟闇€宸遍€夋嫨閫傚悎鑷繁鐨勫氨鍙互浜嗐€傛渶鍚庤繕鏄粰鍑烘垜涓汉鐨勬帹鑽愶紝瀵逛簬 HTTP 鏈嶅姟鍣細鍏嶈垂锛岹atling, Locust锛涙敹璐癸紞LoadUI Pro銆?/span>
以上是关于的主要内容,如果未能解决你的问题,请参考以下文章