![性能測試工具LoadRunner實驗報告_第1頁](http://file1.renrendoc.com/fileroot_temp2/2021-2/6/81518039-4168-46ed-ae96-6f206f48ac41/81518039-4168-46ed-ae96-6f206f48ac411.gif)
![性能測試工具LoadRunner實驗報告_第2頁](http://file1.renrendoc.com/fileroot_temp2/2021-2/6/81518039-4168-46ed-ae96-6f206f48ac41/81518039-4168-46ed-ae96-6f206f48ac412.gif)
![性能測試工具LoadRunner實驗報告_第3頁](http://file1.renrendoc.com/fileroot_temp2/2021-2/6/81518039-4168-46ed-ae96-6f206f48ac41/81518039-4168-46ed-ae96-6f206f48ac413.gif)
![性能測試工具LoadRunner實驗報告_第4頁](http://file1.renrendoc.com/fileroot_temp2/2021-2/6/81518039-4168-46ed-ae96-6f206f48ac41/81518039-4168-46ed-ae96-6f206f48ac414.gif)
![性能測試工具LoadRunner實驗報告_第5頁](http://file1.renrendoc.com/fileroot_temp2/2021-2/6/81518039-4168-46ed-ae96-6f206f48ac41/81518039-4168-46ed-ae96-6f206f48ac415.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、性能測試工具LoadRunner實驗報告一、概要介紹1.1 軟件性能介紹1.1.1 軟件性能的理解性能是一種指標,表明軟件系統(tǒng)或構(gòu)件對于其及時性要求的符合程度;同時也是產(chǎn)品的特性,可以用時間來進行度量。表現(xiàn)為:對用戶操作的響應(yīng)時間;系統(tǒng)可擴展性;并發(fā)能力;持續(xù)穩(wěn)定運行等。1.1.2 軟件性能的主要技術(shù)指標響應(yīng)時間:響應(yīng)時間=呈現(xiàn)時間+系統(tǒng)響應(yīng)時間吞吐量:單位時間內(nèi)系統(tǒng)處理的客戶請求數(shù)量。(請求數(shù)/秒,頁面數(shù)/秒,訪問人數(shù)/秒)并發(fā)用戶數(shù):業(yè)務(wù)并發(fā)用戶數(shù);注意系統(tǒng)用戶數(shù):系統(tǒng)的用戶總數(shù);同時在線用戶人數(shù):使用系統(tǒng)過程中同時在線人數(shù)達到的最高峰值。1.2 LoadRunner介紹 LoadRunn
2、er是Mercury Interactive的一款性能測試工具,也是目前應(yīng)用最為廣泛的性能測試工具之一。該工具通過模擬上千萬用戶實施并發(fā)負載,實時性能監(jiān)控的系統(tǒng)行為和性能方式來確認和查找問題。1.2.1 LoadRunner工具組成虛擬用戶腳本生成器:捕獲最終用戶業(yè)務(wù)流程和創(chuàng)建自動性能測試腳本,即我們在以后說的產(chǎn)生測試腳本;壓力產(chǎn)生器:通過運行虛擬用戶產(chǎn)生實際的負載;用戶代理:協(xié)調(diào)不同負載機上虛擬用戶,產(chǎn)生步調(diào)一致的虛擬用戶;壓力調(diào)度:根據(jù)用戶對場景的設(shè)置,設(shè)置不同腳本的虛擬用戶數(shù)量;監(jiān)視系統(tǒng):監(jiān)控主要的性能計數(shù)器;壓力結(jié)果分析工具:本身不能代替分析人員,但是可以輔助測試結(jié)果的分析。1.2.2
3、 LoadRunner工具原理代理(Proxy)是客戶端和服務(wù)器端之間的中介人,LoadRunner就是通過代理方式截獲客戶端和服務(wù)器之間交互的數(shù)據(jù)流。1)虛擬用戶腳本生成器通過代理方式接收客戶端發(fā)送的數(shù)據(jù)包,記錄并將其轉(zhuǎn)發(fā)給服務(wù)器端;接收到從服務(wù)器端返回的數(shù)據(jù)流,記錄并返回給客戶端。這樣服務(wù)器端和客戶端都以為在一個真實運行環(huán)境中,虛擬腳本生成器能通過這種方式截獲數(shù)據(jù)流;虛擬用戶腳本生成器在截獲數(shù)據(jù)流后對其進行了協(xié)議層上的處理,最終用腳本函數(shù)將數(shù)據(jù)流交互過程體現(xiàn)為我們?nèi)菀卓炊哪_本語句。2)壓力生成器則是根據(jù)腳本內(nèi)容,產(chǎn)生實際的負載,扮演產(chǎn)生負載的角色。3)用戶代理是運行在負載機上的進程,該進
4、程與產(chǎn)生負載壓力的進程或是線程協(xié)作,接受調(diào)度系統(tǒng)的命令,調(diào)度產(chǎn)生負載壓力的進程或線程。4)壓力調(diào)度是根據(jù)用戶的場景要求,設(shè)置各種不同腳本的虛擬用戶數(shù)量,設(shè)置同步點等。5)監(jiān)控系統(tǒng)則可以對數(shù)據(jù)庫、應(yīng)用服務(wù)器、服務(wù)器的主要性能計數(shù)器進行監(jiān)控。6)壓力結(jié)果分析工具是輔助測試結(jié)果分析。二、LoadRunner測試過程2.1 計劃測試 定義性能測試要求,例如并發(fā)用戶的數(shù)量、典型業(yè)務(wù)流程和所需響應(yīng)時間等。 2.2 創(chuàng)建Vuser腳本 將最終用戶活動捕獲(錄制、編寫)到腳本中, 并對腳本進行修改,調(diào)試等。協(xié)議類型:取決于服務(wù)器端和客戶端之間的通信協(xié)議;腳本類型: init(初始部分),Action(事務(wù)部分
5、),end(退出結(jié)束);腳本錄制:捕獲應(yīng)用程序所執(zhí)行的操作;驗證回放:檢查是否準確模擬了錄制的會話;事務(wù):表示要度量的最終用戶業(yè)務(wù)流程;參數(shù)化:將錄制的一些常來替換為參數(shù);內(nèi)容檢查:LR只檢測到網(wǎng)頁的響應(yīng),就認為是pass而不管當(dāng)前網(wǎng)頁的正確性,所以設(shè)置檢查點,確保在測試時結(jié)果的正確性;迭代次數(shù):action部分的循環(huán)次數(shù)。2.3 創(chuàng)建場景 對Vuser腳本進行場景設(shè)置和負載環(huán)境設(shè)置。場景類型 手動場景:通過定義Vuser組,Vuser腳本和運行腳本的負載生成器來創(chuàng)建場景; 百分比模式:定義場景中要使用的Vuser總數(shù),負載生成器計算機以及要分配給每個Vuser腳本的Vuser占總數(shù)的百分比。
6、 面向目標的場景;定義你希望的測試目標,LR會根據(jù)這些目標自動構(gòu)建場景。編輯計劃:設(shè)置加壓方式、壓力持續(xù)時間和減壓方式等。場景組:選擇組/腳本,虛擬用戶數(shù)量以及負載生成器等。運行時設(shè)置:對腳本進行運行時屬性設(shè)置。三、實驗過程(1)安裝完成進入Loadrunner主界面(2)點擊“Create/Edit Scripts”,啟用后新建一個用戶腳本,因為我們要測試的是Web應(yīng)用所以如下所示,選擇Web(HTTP/Html)協(xié)議(3)點擊Vuser下的Start Recording,出現(xiàn)如下界面:輸入URL地址,開始錄制腳本。Vuser init 是錄制腳本的起始點;Action 是錄制腳本的活動;S
7、user end 是錄制腳本的終止點;(4)腳本錄制完之,點擊Tools工具欄下的Create Controller Scenario選項,會出現(xiàn)腳本的運行次數(shù),確定后會出現(xiàn)如下界面:此界面是規(guī)劃腳本的開始數(shù)目,開始時間,駐留時間,退出時間,同時退出的數(shù)目等。點擊Edit scheduler按鈕出現(xiàn)如下所示界面;1 Ramp UP上圖所示為每15秒運行5個腳本;2 Duration計劃每個腳本的駐留時間;3 Ramp Down規(guī)定每隔多長時間退出多少數(shù)目;點擊OK,出現(xiàn)下圖界面;(5)開始壓力負載測試: 圖示數(shù)據(jù)只為說明,并不是實驗真實數(shù)據(jù)四、實驗結(jié)果:Executive SummaryObj
8、ectivesAdd text hereScenario SummaryTotal Duration (including Ramp Up/Down):10 minutes and 20 seconds.Maximum Running Vusers:50Total Throughput (bytes):Total Hits:Top Time-Consuming TransactionsTransaction NameAve90%vuser_init_Transaction0.1890.675vuser_end_Transaction0.0130.013Action_Transaction0.0
9、010ConclusionsAdd text hereScenario ConfigurationFilesName:Scenario1Results in Session:C:Documents and SettingsAdministratorLocal SettingsTempnoname3resres.lrrSession Name:Session1.lraScheduler InformationStarted On:30-11-2008 14:45:08Ended On:30-11-2008 14:55:29Duration:Run for 000:05:00 (hhh:mm:ss
10、)Load Behavior:Start 5 Vusers every 00:00:15 (hh:mm:ss)ScriptsScriptTypeFilenoname3QTWebC:Documents and SettingsAdministratorLocal SettingsTempnoname3noname3.usrRun Time SettingsQTWebGroupScriptPacingThink TimeNetwork SpeedBrowser cachenoname3noname3As soon as possibleAs recordedMaximum bandwidthYes
11、Users InfluenceDisplays average transaction response times relative to the number of Vusers running at any given point during the load test. This graph helps you view the general impact of Vuser load on performance time and is most useful when analyzing a load test which is run with a gradual load.T
12、itle:Transaction Response Time Under LoadGraph Type:CorrelateBase Graph:Running VusersAdditional:Average Transaction Response TimeGranularity:1 SecondColorScaleMeasurementMin.Ave.Max.SD1Action_Transaction0.00.0015.9380.0481vuser_end_Transaction0.00.0130.6720.0941vuser_init_Transaction0.00.1891.250.4
13、14Vuser Load SchemeDisplays the number of Vusers that executed Vuser scripts, and their status, during each second of a load test. This graph is useful for determining the Vuser load on your server at any given moment.Title:Running VusersCurrent Results:C:Documents and SettingsAdministratorLocal Set
14、tingsTempnoname3resres.lrrFilters:Vuser Status = (Run)Group By:Granularity:16 SecondsColorScaleMeasurementGraph Min.Graph Ave.Graph Max.Graph MedianGraph SD1Run0.022.8502016.742Transaction Response TimesDisplays the average time taken to perform transactions during each second of the load test. This
15、 graph helps you determine whether the performance of the server is within acceptable minimum and maximum transaction performance time ranges defined for your system.Title:Average Transaction Response TimeCurrent Results:C:Documents and SettingsAdministratorLocal SettingsTempnoname3resres.lrrFilters
16、:Transaction End Status = (Pass)Group By:Granularity:16 SecondsColorScaleMeasurementMin.Ave.Max.SD1Action_Transaction0.00.0015.9380.0481vuser_end_Transaction0.00.0130.6720.0941vuser_init_Transaction0.00.1891.250.414Running VusersDisplays the number of Vusers that executed Vuser scripts, and their st
17、atus, during each second of a load test. This graph is useful for determining the Vuser load on your server at any given moment.Title:Running VusersCurrent Results:C:Documents and SettingsAdministratorLocal SettingsTempnoname3resres.lrrFilters:Vuser Status = (Run)Group By:Granularity:16 SecondsColor
18、ScaleMeasurementGraph Min.Graph Ave.Graph Max.Graph MedianGraph SD1Run0.022.8502016.742Transaction SummaryDisplays the number of transactions that passed, failed, stopped, or ended with errors.Title:Transaction SummaryCurrent Results:C:Documents and SettingsAdministratorLocal SettingsTempnoname3resr
19、es.lrrFilters:NoneGroup By:ColorScaleMeasurement1PassAverage Transaction Response TimeDisplays the average time taken to perform transactions during each second of the load test. This graph helps you determine whether the performance of the server is within acceptable minimum and maximum transaction
20、 performance time ranges defined for your system.Title:Average Transaction Response TimeCurrent Results:C:Documents and SettingsAdministratorLocal SettingsTempnoname3resres.lrrFilters:Transaction End Status = (Pass)Group By:Granularity:16 SecondsColorScaleMeasurementGraphs Min.Graphs Ave.Graphs Max.
21、Graphs MedianGraphs SD1Action_Transaction0.00.0010.0020.0020.0011vuser_end_Transaction0.00.0040.0190.00.0081vuser_init_Transaction0.00.1810.7410.0270.282TerminologyLoadRunner ObjectsTermDefinitionVuser ScriptsA Vuser script describes the actions that a Vuser performs during the scenario. Each Vuser
22、executes a Vuser script during a scenario run. The Vuser scripts include functions that measure and record the performance of your application抯 components.Load TestTests a systems ability to handle a heavy workload. A load test simulates multiple transactions or users interacting with the computer a
23、t the same time and provides reports on response times and system behavior.Run-Time SettingsRun-Time settings allow you to customize the way a Vuser script is executed. You configure the run-time settings from the Controller or VuGen before running a scenario. You can view information about the Vuse
24、r groups and scripts that were run in each scenario, as well as the run-time settings for each script in a scenario, in the Scenario Run-Time Settings dialog box.ScenarioA scenario defines the events that occur during each testing session. For example, a scenario defines and controls the number of u
25、sers to emulate, the actions that they perform, and the machines on which they run their emulations.SchedulerThe Schedule Builder allows you to set the time that the scenario will start running, the duration time of the scenario or of the Vuser groups within the scenario, and to gradually run and st
26、op the Vusers within the scenario or within a Vuser group. It also allows you to set the load behavior of Vusers in a scenario.SessionWhen you work with the Analysis utility, you work within a session. An Analysis session contains at least one set of scenario results (lrr file). The Analysis utility
27、 processes the scenario result information and generates graphs and reports. The Analysis stores the display information and layout settings for the active graphs in a file with an .lra extension. Each session has a session name, result file name, database name, directory path, and type.Transactions
28、A transaction represents an action or a set of actions used to measure the performance of the server. You define transactions within your Vuser script by enclosing the appropriate sections of the script with start and end transaction statement.VusersVusers or virtual users are used by LoadRunner as
29、a replacement for human users. When you run a scenario, Vusers emulate the actions of human users working with your application. A scenario can contain tens, hundreds, or even thousands of Vusers running concurrently on a single workstation.Graph InformationTermDefinitionAverageAverage value of the
30、graph measurements.HitsThe number of HTTP requests made by Vusers to the Web server.MaximumMaximum value of the graph measurements.MeasurementThis is the type of resource being monitoredMedianMiddle value of the graph measurements.MinimumMinimum value of the graph measurements.Network DelayThe time
31、it takes for a packet of data sent across the network to go to the requested node and return.Network PathThe Network Path is the route data travels between the source machine and the destination machine.Response timeThe time taken to perform a transaction.Scale (or granularity)In order to display al
32、l the measurements on a single graph, thus making the graphs easier to read and analyze, you can change the scale or (granularity) of the x-axis. You can either set measurement scales manually, view measurement trends for all measurements in the graph, or let Analysis scale them automatically. The L
33、egend tab indicates the scale factor for each resource.Standard Deviation (SD)The square root of the arithmetic mean value of the squares of the deviations from the arithmetic mean.ThroughputThroughput is measured in bytes and represents the amount of data that the Vusers received from the server.Vu
34、ser LoadWhen you run a scenario, the Vusers generate load or stress on the server. LoadRunner monitors the effect of this load on the performance of your application.五、實驗小結(jié)一、關(guān)聯(lián)的格式和使用方法 web_reg_save_param( WCSParam_Diff1, LB=userSession value=, RB=, Ord=1, Search=Body,RelFrameId=1, LAST ); 第一個參數(shù): 表示把
35、關(guān)聯(lián)的內(nèi)容都記錄到這個變量里??梢园阉?dāng)成一個變量。 第二個參數(shù): 左邊的值 第三個參數(shù): 右邊的值 第四個參數(shù): ORD ,當(dāng)它的值是1的時候,表示在HTML腳本里只取第一個獲取關(guān)聯(lián)的內(nèi)容,如果在后面的文本里也有相同關(guān)聯(lián)的內(nèi)容則不給予處理, 當(dāng)為ALL的時候,則處理HTML腳本里所有的符合關(guān)聯(lián)條件的數(shù)據(jù),變量也自動生成:(WCSParam_Diff1_count)countn=1,2,3,4,5,6,7,8,9. 最后 LAST必不可少。后面兩個參數(shù)可以根據(jù)幫助學(xué)習(xí)web_reg_save_param(fcontent,LB=,RB=,SEARCH=BODY,LAST);/空的關(guān)聯(lián)獲取BOD
36、Y里的內(nèi)容下載文件用二、字符串的格式和寫法 strcpy(str, RB=); strcat(str, lr_eval_string(datemark);/str等于RB=datemark/生成Name=id內(nèi)容strcpy(delstr, Name=);strcat(delstr, id);/ID是字符數(shù)組 sprintf(downloadfile, c:%s%s.rar, lr_eval_string(linkname), lr_eval_string(uid); / sprintf格式的用法三、 文件處理 (1)打開或創(chuàng)建文件if(file = fopen(downloadfile, w
37、b) = NULL) /downloadfile的格式是:c:loadlook.rar 表示文件的路徑,沒有這個文件就會創(chuàng)建look.rar文件。 wb 表示文件的屬性 ,W 可寫 B表示2進制 還有是R可讀 T表示的是.TXT文本文件 (2) write寫文件 fwrite(lr_eval_string(fcontent), filesize, 1, file); 第一個參數(shù):lr_eval_string(fcontent)表示要寫到文件里的內(nèi)容它可以用關(guān)聯(lián)獲得 web_reg_save_param(fcontent,LB=,RB=,SEARCH=BODY,LAST),當(dāng)點擊一個下載的鏈接,
38、那么就回返回一個HTML的內(nèi)容 其中BODY里面的內(nèi)容就是我們要下載的文件內(nèi)容。 第二個參數(shù):表示文件的大小 filesize = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE); 來獲得,具體查看幫助。 第三個參數(shù):表示文件寫入次數(shù)。 第四個參數(shù): FILE LONG型的數(shù),記錄創(chuàng)建文件的路徑和文件的屬性 (3) 關(guān)閉文件 fclose(file);四、消息的輸出 lr_output_message(File open failed!); 輸出到 運行結(jié)果中去五、Step download timeout (120 seconds)這是一個經(jīng)常會遇
39、到的問題,解決得辦法走以下步驟:1、修改run time setting中的請求超時時間,增加到600s,其中有三項的參數(shù)可以一次都修改了,HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分別建議修改為600、600、5000;run time setting設(shè)置完了后記住還需要在control組件的option的run time setting中設(shè)置相應(yīng)的參數(shù);2、辦法一不能解決的情況下,解決辦法如下:設(shè)置runt time setting中的internet protocol-
40、preferences中的advaced區(qū)域有一個winlnet replay instead of sockets選項,選項后再回放就成功了。切記此法只對windows系統(tǒng)起作用,此法來自zee的資料。六、問題描述Connection reset by peer這個問題不多遇見,一般是由于下載的速度慢,導(dǎo)致超時,所以,需要調(diào)整一下超時時間。解決辦法:Run-time setting窗口中的Internet ProtocolPreferences設(shè)置set advanced options(設(shè)置高級選項),重新設(shè)置一下“HTTP-request connect timeout(sec),可以稍微設(shè)大一些”;七、問題描述connection refused這個的錯誤的原因比較復(fù)雜,也可能很簡單也可能需要查看好幾個地方,解決起來不同的操作系統(tǒng)方式也
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度住宅小區(qū)空調(diào)設(shè)備租賃與維護服務(wù)合同
- 2025年度網(wǎng)絡(luò)安全服務(wù)合同匯編指南
- 2025年度酒吧應(yīng)急物資儲備與供應(yīng)合同
- 2025年度裝配式建筑構(gòu)件生產(chǎn)與施工一體化合同范本
- 2025年度大型體育賽事運營與管理合同
- 2025年度建筑材料租賃及工程質(zhì)量監(jiān)督合同范本
- 2025年度房地產(chǎn)廣告設(shè)計委托合同樣本
- 2025年度化妝造型行業(yè)人才培養(yǎng)與實習(xí)合同
- 2025年公司內(nèi)部員工信用貸款合同范本
- 2025年度建筑幕墻工程分包合同樣本
- 引水隧洞施工支洞專項施工方案
- 高標準農(nóng)田建設(shè)項目檔案資料驗收清單
- 《教育心理學(xué)(第3版)》全套教學(xué)課件
- JT-T-496-2018公路地下通信管道高密度聚乙烯硅芯塑料管
- 貴州省銅仁市2024年中考英語模擬試卷(含答案)
- DB43-T 2939-2024 醬腌菜咸胚中亞硝酸鹽的測定頂空-氣相色譜法
- 藥品不良反應(yīng)監(jiān)測工作制度及流程
- 食材配送投標方案技術(shù)標
- 《電力系統(tǒng)自動化運維綜合實》課件-通信設(shè)備接地線接頭制作
- 國際標準《風(fēng)險管理指南》(ISO31000)的中文版
- 再見深海合唱簡譜【珠海童年樹合唱團】
評論
0/150
提交評論