LoadRunner80_total_china课件_第1页
LoadRunner80_total_china课件_第2页
LoadRunner80_total_china课件_第3页
LoadRunner80_total_china课件_第4页
LoadRunner80_total_china课件_第5页
已阅读5页,还剩111页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、LoadRunner Quick TutorialLR78-SLIDES-01A第一节第一节LoadRunner 介绍介绍为什么要进行压力测试为什么要进行压力测试The failure of a mission-critical application can be costlyAssure performance and functionality under real-world conditionsLocate potential problems before your customers doReduce development timeReduce infrastructure c

2、osts压力测试分类压力测试分类Find out whether the system can handle the expected load upon deployment under real-world conditions. Find the applications breaking point. Apply testing that measures whether the applications environment is properly configured to handle expected or potentially unexpected high transa

3、ction volumes.Load TestingStress TestingFind the stability of the system with respect to handling large amounts of data over extended time periods. Volume TestingFind the behavior and performance of each tier. Component Testing压力测试目标举例压力测试目标举例 Application response timeHow long does it take to comple

4、te atask? Configuration sizingWhich configuration provides thebest performance level? AcceptanceIs the system stable enough to gointo production? RegressionDoes the new version of the softwareadversely affect response time? ReliabilityHow stable is the system under aheavy work load? Capacity plannin

5、gAt what point does degradation inperformance occur? Bottleneck identificationWhat is the cause of degradation inperformance? Product evaluationWhat is the best server for 100users?TestersLoad GenerationSystem Under TestDo you have the testing resources? Testing personnel Client machinesHow do you s

6、ynchronize users?How do you collect and analyze results?How do you achieve test repeatability?Everybody, click the SEARCH button again手工测试的问题手工测试的问题CoordinatorDatabase serverApplication serverLoadRunner解决方案解决方案Overcomes resource limitations Provides meaningful results with analysis tools Allows repe

7、atable tests with scripted actionsAnalysis Runs many Vusers on few machines Replaces testers with Virtual Users Controller manages Virtual UsersDatabase serverControllerVusersVirtual User load generatorApplication serverLoad GenerationSystem Under TestLoadRunner的实现方法的实现方法LoadRunner is a complete sol

8、ution to conduct automated load testing before, during, and after application deployment.LoadRunner allows you to.ScaleIdentifyDiagnosethe application to a predetermined capacity.business processes or system components having trouble.a problem to pinpoint the root cause.LRVUGENVuser Script Recorder

9、records Vuser scripts that simulate the steps of real users using the application.LR CONTROLLERThe Controller is an administrative center for creating, maintaining and executing Scenarios. The Controller assigns Vusers and load generators to Scenarios, starts and stops load tests and performs other

10、administrative tasks.LRANALYSIS LR Analysis provides graphs and reports. These graphs and reports summarize the system performance.LoadRunner 组件组件This course focuses on LR Controller and LR Analysis. LR VuGen is discussed in a separate course.LoadRunner 支持的环境支持的环境 Web:HTTP(S)CORBAWAPCOMRMILDAPWinsoc

11、kStreamingFTPIIOPPOP3iModeRealPlayerMS MediaVoice XMLSMTPDatabases:OracleMS SQLServerDB2 SybaseInformixODBCMiddlewareProtocols:CORBACOMEJBsTUXEDOJoltJDBCMQSeriesPlatforms:NT, 2000, XPSunHPIBMLinuxERP/CRM:Oracle Apps.SAPSiebelPeopleSoftClarifyBaanLegacy:32705250VT100Internet/IntranetDatabaseserverApp

12、serversWebserversClients什么是什么是 Scenario?scriptsrun-time settingsload generatorsreal-time monitorsvirtual usersElements of a ScenarioScenarioA scenario is a file that defines which Vusers to execute, the number of Vusers to run, the goals of the test, which computer hosts the Vusers and the condition

13、s under which to run the load test.LoadRunner的工作方式的工作方式DatabaseserverAppserversWebserversLR CONTROLLER LOAD GENERATOR 2 (NY)LRANALYSIS LOAD GENERATOR 1 (SF)Create scenarios and assign them to load generators.Generates load and sends performance data to controller. Access the reports and graphs.Gener

14、ates load and sends performance data to controller.Performance metrics硬件配置需求硬件配置需求Win NTWin 2000 Win XP500 MBWin NTWin 2000 Win XP UNIXDepends on the number of Vusers and runtime settings.Win NTWin 2000 Win XP200 MB Operating SystemFree Hard Disk Space256 MB256 MB256 MBMemoryAnalysisLoad GeneratorCo

15、ntrollerLR Components压力测试流程压力测试流程Define GoalsAnalyze systemGather System Usage DataRecord Scripts and turn scripts into Vusers by adding test data and user behavior Create Scenarios based on your goalsExecute Scenarios for testing first, running 100% and overloadingAnalyze results data and pinpoint

16、bottlenecksFine tune system based on analysis data and re-run the scenarioTweakSystem Basedon AnalysisPlan Load Test1Create Virtual Users2Scenario Creation3Scenario Execution4Results Analysis5Rerunning the scenario indicates whether performance has improved and whether goals have been achieved. 压力测试

17、是一项团队工作压力测试是一项团队工作Manages the test application implementation for all phases of load testingProvides expertise on the business functionality of the application under test for planning phaseTeam MemberMain ResponsibilityProject ManagerFunctional ExpertCreates the multi-user load on the system for all

18、 phases of load testingLoadRunner ExpertAnalyzes and tunes the application server for results analysis phase Application Server Performance Basis ExpertAnalyzes and tunes the database server for results analysis phaseDatabase Performance Basis ExpertLoadRunner 团队工作团队工作TweakSystem Basedon AnalysisPla

19、n Load Test1Create Virtual Users2Scenario Creation3Scenario Execution4Results Analysis5LR ExpertFunctional ExpertProject ManagerLR ExpertFunctional ExpertProject ManagerLR ExpertLR ExpertSys AdminServer Expert(s)Sys AdminServer Expert(s)LR Expert第二节第二节 规划规划在创建脚本之前要进行充分的规划在创建脚本之前要进行充分的规划Plan Load Tes

20、t1Create Virtual Users2Scenario Creation3Scenario Execution4Results Analysis5Goals, business processes, user type, user behaviors, input data, system profiling,scenario design, and LoadRunner installation规划阶段的内容规划阶段的内容 建立负载测试的目标 制定出可以用数量衡量的目标标准 分析被测系统的业务运行状况确定要录制哪些商业流程(business processes)确定业务高峰的负载情况

21、和时间把需要测试的BP的操作步骤形成正式文档准备测试数据 收集系统的技术信息 确定系统的架构 确定系统各部件的软件情况,使用什么样的数据库服务器?Web服务器? 以帮助我们在合理的时间内确定系统瓶颈本次培训使用的本次培训使用的Demo软件软件Start Programs Mercury ToursBefore you access thetraining application:Invoke the ApacheServer (Start Programs StartServer)第三节第三节编写脚本编写脚本录制录制Web脚本的方法脚本的方法1. 运行运行VuGen,创建新的脚本,创建新的脚本

22、4. 开始录制5. 进行正常的业务流程的操作6. 当业务操作完毕后,按Stop Recording将录制结束7. 保存脚本2. 选择创建Web(HTTP/HTML) protocol的脚本3. 设定录制选项 Recording Options.DEMO 老师将会演示如何录制脚本设定录制选项设定录制选项 Recording Options Recording Browser Recording Proxy Advanced CorrelationDEMO Recording Options 两种不同查看脚本的方式两种不同查看脚本的方式Tree ViewScript ViewTree view h

23、as icons for the recorded user stepsEach Tree View icon represents a C statement viewable in Script View DEMO Tree and Script View Icon and usage examples什么时候选择不同的录制方式?什么时候选择不同的录制方式?This is default mode.If problem encountered with form submission or with link clicking then record with URL option che

24、cked under HTML Advanced HTML Recording:URL Recording:Records a separate request for each object requested from the server. Gives best control over traffic.脚本的目录结构脚本的目录结构C:web_project-Scripts-Action1.cvuser_init.cvuser_end.cLab1Script2.usrAs soon as the script is saved, these are the folders that yo

25、u will seeLab1Script2设置回放的运行时刻设置设置回放的运行时刻设置Run-time SettingsRun LogicPacingLogThink TimeMiscellaneousSpeed SimulationBrowser EmulationProxyPreferencesContentCheckAvailable for all protocols.Specific to Web.DEMO Run-time Settings 运行脚本运行脚本Click the Run button to play back the script.The Execution log

26、lists all messages once the script has stopped running. DEMO Running a script and how to set results directory 常用的调试脚本的工具常用的调试脚本的工具Test Results windowExecution LogSnapshot Results window Page View Server Response Client RequestRun-Time ViewerDEMO Available debugging tool options本节总结本节总结本节介绍了常用的录制选项本

27、节介绍了常用的录制选项本节介绍了两种录制本节介绍了两种录制Web协议脚本的方法协议脚本的方法本节介绍了运行时刻的各种设定本节介绍了运行时刻的各种设定本节介绍了一般选项的设定本节介绍了一般选项的设定本节介绍了进行调试脚本的基本工具本节介绍了进行调试脚本的基本工具ActionA set of recorded user actions in a Vuser that allows you to emulate a particular user task through script iteration.什么是什么是Action?在在Web脚本里面使用多个脚本里面使用多个ActionA Web V

28、user (script):Search for a CDOrder the CDLog inGo to checkoutvuser_initRun onceActionRun 3 timesvuser_endRun onceSearch for a DVDOrder the DVDAction1Run 5 timesSearch for a book Order the book Action2Run 4 timesthenthenthenthen使用多个使用多个 Action的典型例子的典型例子最典型的情况是用户登录一次,进行多次业务,然后退出系统最典型的情况是用户登录一次,进行多次业务,

29、然后退出系统: Record Login user steps in vuser_init Record selecting an item in the first section called Action Record placing items in shopping cart user steps in Action1 Record Checkout and Logout user steps in vuser_endInternetWebserverDBserver如何把不同的操作录制到多个如何把不同的操作录制到多个 Actions中中?Action list1. Start re

30、cording2. Select action file3. Record users steps in the appropriate action file4. Repeat steps 2 and 3 as necessary5. Stop recordingDEMO Adding creating LR Actions 注意设定好开始和结束的状态注意设定好开始和结束的状态Always end at this page if the next iteration is Sign-On or Register.根据测试目标来确定脚本的根据测试目标来确定脚本的Action Emulate t

31、hree types of users where 50% of the users are logging in, 25% are searching and the remaining 25% are booking tickets?Load Testing Goal: Record one script with all three business processes under separate actions and apply weighting.Suggested method:DEMO Creating Weighting如何衡量操作的响应时间?如何衡量操作的响应时间?How

32、 can I isolatea measurement ofjust the Sign-inresponse time?STEP 1 Start ApplicationSTEP 2 Type username and passwordSTEP 3 Click on Sign-In buttonSTEP 4 Wait for confirmationSTEP 5 Select a departure and arrival citiesSTEP 6 Enter datesSTEP 7 Enter credit card detailsSTEP 8 Click on Submit 什么是什么是Tr

33、ansaction? LoadRunner TransactionGives an end-to-end measurement of time elapsed in the execution of one or more steps in a business process.UserWeb ServerRequest(Transaction starts)Response(Transaction ends)Sign-In transaction took 8 secLoadRunner的的Transactions测量什么内容测量什么内容?LoadRunner transactions m

34、easure the transmission and response time between client and server.Transaction开始和结束按钮开始和结束按钮Common icons and usage examplesStart Transaction Set starting point for measurementEnd TransactionSet end point for measurementTransaction的状态的状态LR_AUTO (default) - use this to detect the transaction status a

35、utomatically LR_PASS / LR_FAIL / LR_STOP use these when you want to set the transaction status manually in the codeTransactions中的思考时间如何处理?中的思考时间如何处理?Think times May reduce accuracy of transaction measurements Can be filtered out of Analysis graphs通过检查运行日志来确定通过检查运行日志来确定Transaction的执行结果的执行结果Transactio

36、ns的相关设定的相关设定参数化的概念参数化的概念 Recorded ScriptSelect San FranciscoParameterized ScriptSelect Selection is hard coded and will select San Francisco on every runSelection is parameterized and will select different city on every run为什么要引入为什么要引入“参数化参数化”? REAL USERSVaried input to the applicationStatic input t

37、o the applicationRecorded script (Virtual Users)To Emulate real-world behavior and to create realistic results什么时候需要参数化?什么时候需要参数化?STEP 1 Start ApplicationSTEP 2Type username and passwordSTEP 3 Click on Sign-In buttonSTEP 4Wait for confirmationSTEP 5Select a departure and arrival citiesSTEP 6 Enter d

38、atesSTEP 7Enter credit card detailsSTEP 8Click on Submit Unique constraintData dependencyData cachingDate constraint如何参数化输入数据如何参数化输入数据 Determine which fields to parameterize.Replace recorded values with parameters.Decide which parameter type to use.Create the data file.Populate the data file.Choose

39、the data access method and the number ofiterations.Run the Vuser and analyze the results to verify correct execution.DEMO How to parameterize a input data 参数的类型参数的类型 Internal DataData FilesMaster DataUser Generated Data External DataUser-Defined Functions Specifying the source for the parameter data

40、. There are three types:File类型参数的数据访问方式类型参数的数据访问方式 Sequential Random Unique Same line as Select next tells LoadRunner in what order to use data from the file (data source) 如何查看脚本执行时参数的值?如何查看脚本执行时参数的值?To see parameter data in the Execution Log, select Extendedlog and Parameter substitution in the Run

41、-time Settings数据个数和数据个数和Run Logic的关系的关系To test all data using the Sequential access method, Number of Iterations should equal the number of rows in the data file 什么是检查点什么是检查点 Checkpoint? CheckpointA checkpoint is a step in a Vuser script which verifies whether a visual cue appeared as expected.Verif

42、ication always results in a PASS or FAIL status在大并发用户压力的情况下验证脚本是否执在大并发用户压力的情况下验证脚本是否执行成功是负载测试的基本要求行成功是负载测试的基本要求Success. Business process complete.Failure. Business process failed.One Vuser running the scriptScript run under load with many concurrent VusersIncrease in load Low load What indicates the

43、 ticket was purchased successfully?确定脚本执行成功的标准确定脚本执行成功的标准 LoginSelect departure and arrival citiesSelect departure and arrival datesSelect flightPurchase ticketContinue ShoppingThere was an error while generating your order! Your itinerary was booked! Thank you for choosing Mercury Tours.通过界面的某些信息来确

44、定脚本是否执行成功通过界面的某些信息来确定脚本是否执行成功Flight confirmation image and text appear after pressing the Secure Purchase button. Image ConfirmationText Confirmation(2) On playback, compare the actual value on the application to the saved expected value.(3) Send the comparison result (the status) as either PASS Tes

45、t requirement # 5 successful.OR FAIL Test requirement # 5 failed.(1) Capture the information needed to perform verification.检查点的基本内容检查点的基本内容 ExpectedValueActualValuePASSIFLoadRunner提供的文本检查点提供的文本检查点Checkpoint IconsTextVuGen allows you to add Checkpoints for verification automatically and also program

46、matically. A text check is a search for a specified text string on a Web page.Adds web_reg_find function to the script.关联的基本概念介绍关联的基本概念介绍 RecordingWeb ServerLogin (User Name jojo Password bean)Response(SessionID12345 )1.Log in User Name jojo Password bean2.Your sessionid123453.Request for product in

47、fo4.Product info foundResponseProduct infoVuGen ScriptRequest for product info (SessionID12345 )Dynamic data is hard-coded in the script关联的基本概念介绍关联的基本概念介绍 - Playing BackWeb ServerLogin (User Name jojo Password bean)Response(SessionID23456 )1.Login User Name jojo Password bean2.Your sessionid123453.R

48、equest for product info4.Product info foundResponseERROR SessionID 12345 has expiredLogin again to get product infoVuGen ScriptRequest for product info (SessionID12345 )Reusing recorded dynamic data will cause errors when you replay the script关联的基本概念介绍关联的基本概念介绍 - SolutionWeb ServerLogin (User Name j

49、ojo Password bean)Response(SessionID23456 )Request for product info ()ResponseHere is the requested product info1. 2.Your 3. 4. Correlated VuGen ScriptRecorded dynamic data must be correlated using parameters关联是一个原理性的问题关联是一个原理性的问题2 1 3关联是一个原理性的问题,在任何协议的脚本中都存在关联是开发脚本的最耗时,最烦琐的一个过程. 因为每个被测系统都不同 为了减轻关联的

50、工作量,LoadRunner提供了一些自动化关联的辅助工具手工关联的基本步骤手工关联的基本步骤Play back the script and determine if error is due to correlation.Determine which dynamic values to correlate.Find the left boundary, right boundary and occurrence of the dynamic value. Add a web_reg_save_param function and the arguments to the script,

51、above the step which requests the page with the value to capture.Parameterize the dynamic value in the script every time it occurs.Verify correct execution.关联的第一步:脚本回放失败关联的第一步:脚本回放失败Q: Why did the step creation fail? 1. Make a note of which step failed. 2. Investigate the Execution Log.通过通过WDiff查看脚本

52、变化的内容查看脚本变化的内容 There are five differences highlighted.确定哪些动态信息需要关联确定哪些动态信息需要关联Name=buyFlights.x, Value=52, ENDITEM, Name=buyFlights.x, Value=23, ENDITEM,Name=buyFlights.y, Value=15, ENDITEM, Name=buyFlights.y, Value=17, ENDITEM,lr_think_time( 2 );lr_think_time( 1 );lr_think_time( 7 );lr_think_time(

53、11 );Name=flight_210, Value=on, ENDITEM,Name=flight_206, Value=on, ENDITEM,Name=removeSelected.x, Value=101, ENDITEM, Name=removeSelected.x, Value=80, ENDITEM,Name=removeSelected.y, Value=13, ENDITEM,Name=removeSelected.y, Value=10, ENDITEM,lr_think_time( 1 );12345 These values represent the screen

54、locations of mouse clicks They are used by the script but do not need to be correlatedThink times are used by the script but do not need to be correlatedFlight number is dynamic and requires correlation关联的函数关联的函数: web_reg_save_param(param_name, *, LAST);User-defined parameter nameIndicates no more a

55、ttributes Optional indicates ordinal or instance or the match The left & right boundary of the parameter or the dynamic data LB=, RB=, ORD=, *See the LoadRunner documentation for a complete list of attributesweb_reg_save_param has the following arguments:在在Server Response中确定动态信息的左右边界中确定动态信息的左右边界LEFT

56、 BOUNDARYRIGHT BOUNDARYLB: type=checkbox name=RB: 6脚本录制完成后自动关联的方法脚本录制完成后自动关联的方法需要将脚本回放一次需要将脚本回放一次LoadRunner会自动比较回放时的结果和录制时的结果,确定需会自动比较回放时的结果和录制时的结果,确定需要关联的内容要关联的内容回放完成后可以使用回放完成后可以使用LoadRunner内置的内置的Scan for Correlations工具进行自动关联工具进行自动关联脚本录制时自动关联的步骤脚本录制时自动关联的步骤Enable Correlation during recording in Rec

57、ording OptionsCreate new applicationCreate new rule for the newly created application and define properties for the new ruleTest the newly created rule (optional)Record the scriptPlay back the script to verify correct execution DEMO Correlation During Recording 第四节第四节Scenario 设计设计 Understanding Scen

58、arios Scheduling Scenarios Runtime Settings Performance Monitors目标目标TweakSystem Basedon AnalysisPlan Load Test1Create Virtual Users2Scenario Creation3Scenario Execution4Results Analysis5什么是什么是 Scenario?scriptsrun-time settingsload generatorsreal-time monitorsvirtual usersElements of a ScenarioScenar

59、ioA scenario is a file that defines which Vusers to execute, the number of Vusers to run, the goals of the test, which computer hosts the Vusers and the conditions under which to run the load test.LoadRunner Controller Before scenario execution used to design scenario used to initiate scenario runDu

60、ring scenario execution runs many Vusers simultaneously controls each Vuser (initialize, run, pause, stop) displays execution status of each Vuser displays messages from each Vuser monitors system and network resourcesAfter scenario execution collects and organizes performance data launches the Anal

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论