junit.docx

上传人:b****1 文档编号:13484961 上传时间:2023-06-14 格式:DOCX 页数:25 大小:179.74KB
下载 相关 举报
junit.docx_第1页
第1页 / 共25页
junit.docx_第2页
第2页 / 共25页
junit.docx_第3页
第3页 / 共25页
junit.docx_第4页
第4页 / 共25页
junit.docx_第5页
第5页 / 共25页
junit.docx_第6页
第6页 / 共25页
junit.docx_第7页
第7页 / 共25页
junit.docx_第8页
第8页 / 共25页
junit.docx_第9页
第9页 / 共25页
junit.docx_第10页
第10页 / 共25页
junit.docx_第11页
第11页 / 共25页
junit.docx_第12页
第12页 / 共25页
junit.docx_第13页
第13页 / 共25页
junit.docx_第14页
第14页 / 共25页
junit.docx_第15页
第15页 / 共25页
junit.docx_第16页
第16页 / 共25页
junit.docx_第17页
第17页 / 共25页
junit.docx_第18页
第18页 / 共25页
junit.docx_第19页
第19页 / 共25页
junit.docx_第20页
第20页 / 共25页
亲,该文档总共25页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

junit.docx

《junit.docx》由会员分享,可在线阅读,更多相关《junit.docx(25页珍藏版)》请在冰点文库上搜索。

junit.docx

junit

LoadTestingWebApplicationsusing

Microsoft’sWebApplicationStressTool

 

ByRickStrahlhttp:

//www.west-

 LastUpdated:

10/17/2018

 

Microsoft'sWebApplicationStressToolprovidesaneasywaytosimulatelargenumbersofusersagainstyourWebapplication.Thistoolmakesitpossibletomakeintelligentdecisionsabouthardwareandsoftwareloadincurredbyyourapplicationandhowmuchtrafficagivenmachineorgroupofmachinescanhandle.InthisarticleRickshowshowthetoolworksandhowtoproperlyinterprettheperformancedataitgenerates.

 

FreeDownloadfrom:

 

Requires:

WindowsNT4.0SP4orWindows2000

 

BuildingWebapplicationshasnowbecomeafairlycommonscenariofordevelopersbuildingnewapplicationsorupdatingandWebenablingexistingapplications.AsapplicationsmovetotheWebintoaserverbasedenvironmentitbecomesincreasinglyimportanttobeabletogaugetheperformanceandloadcapabilityofanapplication.Developersmustbeabletoanswerhardquestionsabouthowmuchtrafficagivensitewillbeabletohandleandmakeintelligentchoicesofhardware,softwareandoftentimesevendesignapproachoftheapplicationtomakesuretheapplicationwillbeabletohandleanonslaughtofcustomersontheWebsite.Weshouldallbesoluckytohavetoworryabouttheproblemofbeingtoosuccessful!

 

Butit'softensurprisingtofindhowmanyWebsiteshittheirlimitsandcatchtheoperatorsoffguard.AnoverloadedWebsiteisamajorproblemandoncehappeningtheproblemoftencan'tbeaddressedrapidly.Aquickfixtypicallyinvolvesaddingadditionalhardwarethatmustbepurchased,installedandconfigured–aprocessthatmaytakedaysorevenweeks.Beingpreparedandunderstandingthelimitsofanapplicationandmanagingadvertisingtobringtraffictoasiteinmeasuredspurtsiscrucialtothesuccessoflargeandevennotsolargecommercialsites.

 

Additionally,it'simportanttounderstandthattoday'stoolsoftenmakeitmucheasiertobuildWebapplicationsthanthetoolsfromevenayearago.Todaywehavepowerfulscriptingengines,easyaccesstoCOMcomponentswecanwriteinhighlevellanguagesandWebserversthatself-configureforthemostpart.Butalongwiththeeaseofusealsocomesmoreoverheadandresourceloadontheserveranditbecomesevenmoreimportanttolookatloadissuesrightfromthestartofapplicationdevelopment.Loadtestingshouldbeperformedintheinitialdesignphasestogetagoodideawhatoverheadtheapplicationcomponentsincurontheserver.Constantmonitoringshouldbeperformedasdevelopmentcontinuesonalwayskeepingacloseeyeonhowwellthesoftwareplatforminrelationtothehardwareitwillberunningon.

 

Theproblemisthatoftentimesthesescalabilityquestionssuchas'Howmuchtrafficcanwehandleonourparticularhardware?

'arenoteasilyansweredbecauseit’shardtomeasureperformanceofWebapplicationsoutsidetheactualenvironmentthattheywillberunningin.EventheprocessoftestingWebapplicationsseemsdaunting:

TherearesomanypiecesinvolvedfromaWebbrowserclient,theWebserver,thebackendapplicationandthebackenddatabaseserver.ThebottomlineisthattheonlywaytorealisticallytesttheloadcapabilitiesofaWebapplicationisinacloseapproximationofaliveenvironment,whichmeansactually'running'theWebapplication.

IntroducingtheWebApplicationStressTool

So,howdowe'run'aWebapplicationrealistically?

Theansweristhatyouhavetosimulatemanyclientssimultaneouslyhittingyoursite.Tothisend,Microsofthasreleasedaneasytouse,yetverypowerfulandflexibletoolcalledtheWebApplicationStresstool(WAS),whichprovidesthisfunctionalityinafreelydownloadableapplicationservice.

 

Figure1–TheWebApplicationStresstoolprovidesasimpleinterfacetocapture,configure,runanddisplaytheresultfromrunningastresstest.InthisviewthecapturedWeblinksthatwillbeaccessedbytheWebclientwhenrunningthetestarelisted.

 

WASrequiresWindowsNTorWindows2000asthetoolrunsasanNTService.Forrealisticperformancetesting,it'salsorecommendedthatyourunthestresstestingtoolfromaseparatemachineotherthantheWebserver.TheactualrequestgeneratorcanbefairlyresourceintensivewhilegeneratingtheWebrequestsandthisoverheadcanaffectperformanceoftheWebsiteundermaxloads.However,eventhoughthedocumentationstatestwomachinesarearequirementyoucancertainlyrunWASonthesamemachineastheWebserver,butdon'texpect100%accurateresultsespeciallywhenyou'retestingatthetopendloadforthehardwareyou'rerunningon.

TheuserinterfaceofWASisstraightforwardwithalistofscriptsandsublistsofthepropertiesfortheparticularscriptontheleftandadataviewontheright.Thedataviewdependsontheselectedscriptoption.Themostimportantviewsarethedefaultview(seeFigure1)thatshowsyouallselectedlinksandtheserveryou'retestingandtheSettingsview,whichconfigureshowthelinksareexecutedagainsttheserverandatwhatloadlevel.Otheroptionsallowyoutoconfigureuserswithusernamesandpasswords(optional)sinceyoucansimulatelargenumbersofclientsthismaybenecessaryforsitessecuredwithsomelevelofauthentication.Youcanevenconfigurespecificpre-existingCookievaluesforeachuserifyouhaveto.Inshort,therearealotofoptionsformostHTTPscenariosavailable,eventhoughmostoftheseareunlikelytobeutilizedintypicaltests.It'sthereforyouifyouneedthecontroltocustomizeyourtests.

 

Onceatesthasbeencompletedthere'sareportviewwhereyoucanviewtheresultsofthetest,whichprovidesathoroughsummaryofthetestjustperformedincludinginformationabouttotalhitsandhitspersecondasawhole,hitsforindividualpages,failuresandresponsecodesaswellasbandwidthbreakouts.

 

Figure2–Thereportpageprovidesasummaryofthetestrunincludingtotalnumberofrequests,requestspersecondandfailures.There'salsoadditionaldetailabouteachlinkandaveragerequesttimesofeachlink.

 

GettingstartedwithWAS

TheconceptbehindWASissimple:

YoucreateatestscriptbycapturingabrowsersessionusingInternetExplorerbasicallywalkingthroughyourapplication,asatypicaluserwoulddo.AsyoudothisWAScapturesthecontentofalltheseWebrequests.WAScaptureseverything:

Hyperlinkclicks,Formsubmissions,RedirectlinksandAuthenticationinfo–everythingneededtocapturetheuser'ssessionthroughyoursite.

 

Figure3–TheBrowserRecorderletsyouuseyourbrowsertocreatescripts.Therecordercapturesalllinks,HTMLformsubmissionsandevenCookies,RedirectsandAuthenticationinformation.

 

 

Creatingascriptisveryeasy:

YoucanusetheBrowserRecordertocaptureabrowsersessionandhaveWASgenerateatestscriptfromcapturedlinks.Amanualmodeisalsoavailabletoallowyoutomanuallyaddlinksandinformationabouteachlink.

 

AsyoucanseeinFigure3thereareafewoptionsyoucanchoosefortheBrowserRecorder:

Capturedelay,andrecordcookiesandhostheaders.Thedelaybetweenrequestswillresultamorerealistictestintermsofhowpeopleareactuallynavigatingasite,givingyouamoreaccuratepictureofhowusersonasitemaptoconnectionsontheWebserver.Ifyourgoalistofindthelimitsofyoursiteleavethisoptionunchecked.Ifyouwanttosimulateaspecificusernumberscenariogoaheadandcapturethedelayasitprovidesamorerealisticviewofthebrowsingscenario.I'lltalkmoreaboutthisdelaywhenwelookattheloadoptionsforthetest.

 

TheRecordbrowsercookiesandRecordhostheaderoptionsallowyoutocaptureaspecificusersession,ratherthandynamicallytrackingthisinformationatthetimeoftherequest,thelatterofwhichishowatypicalbrowserwouldbehave.Typicallyyou'llwanttoleavethoseoptionsuncheckedtolettheWASclientcreatecookiesandhostheadersjustlikeauseronyoursitewould.However,ifyouhavepersistentstateinformationforyoursite(suchasauserprofileorotherinfothatisconnectedtoapermanentcookie)makesurethatyouclearthecookiebeforeyourunyourteststosimulateanewusercomingtothesiteandgoingthroughthestepsofconfiguringtherequireduserstate.Forexample,onmyWebStoresiteuserssetupauserprofilewhentheyplaceanorder.TheprofileisrecoveredwhentheyreturntothesiteandtrackedwithaCookie.IfIneverwentthroughandsetupmyprofileinformationWASwouldnotbeabletoactuallyprocessanorderbecausetheprofileinformationwouldbemissingandnotgetfilledout.

IfyoutypicallyrequireuserswithanestablishedcookieandprofilethenmakesurethatyoudochecktheCapturebrowsercookieoption.

 

Note:

ThecurrentversionoftheWASBrowserRecorderdoesnotsupportHTTPS/SSLrequestsatthistime.TocapturerequestssecurerequestsyouhavetotemporarydisableSSL(临时禁用SSL).IfyouhavetohaveSSLforaccuratetesting,youcanthenmanuallychangetheindividualrequestsinthelinklistandenableSSLoperationonthem.

 

WhenyouclickNext|Finishonthebrowserrecorderyou'llbewhiskedintoIEandyou'rereadytocapturerequestsinyourbrowser.InmycaseIranatestagainstmyWestWindWebStoreonmydevelopmentmachinestartingwiththehomepageandtypingthatlinkintothebrowser'saddressline.AfterthatI'moffonmydevsiteandwithWAScapturinglinks.ThissitehappenstobeWebstoreapplicationthatreliesonCookiestotrackusers,handlesprofileinformationforcustomersandsecureorderprocessingviaHTT

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2