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>

以上是关于的主要内容,如果未能解决你的问题,请参考以下文章

Python 操作Redis

python爬虫入门----- 阿里巴巴供应商爬虫

Python词典设置默认值小技巧

《python学习手册(第4版)》pdf

Django settings.py 的media路径设置

Python中的赋值,浅拷贝和深拷贝的区别