Loadrunner中Throughput(吞吐量)的分析與計算
核心提示:Throughput翻譯為吞吐量,按照常規理解網絡吞吐量表示在單位時間內通過網卡數據量之和
Throughput翻譯為吞吐量,按照常規理解網絡吞吐量表示在單位時間內通過網卡數據量之和,其中即包括本機網卡發送出去的數據量也包括本機網卡接收到的數據量,但這個理解在Loadrunner記錄的Throughput中是錯誤的!
先提出正確的結果,然后用具體的試驗加以證明:
Loadrunner記錄的Throughput是接收到服務器返回的所有字節數之和,與本地發出的字節數無關!
我們用baidu.com做個試驗,過程很簡單:
1、使用VUGen錄制baidu的首頁,僅打開首頁即可
2、在Recording Log中記錄客戶端和服務器端的數據發送情況,統計發出的字節總數和接收到的字節總數。
Recording Log內容如下:
Request Connection: Remote Server @ 220.181.6.19:80 (Service=) (Sid= 1) PROXIED!
"GET /"
(Sid: 1) Client -> Server : 407 bytes (Service=HTTP)
(Sid: 1) Server -> Client : 208 bytes (Service=HTTP)
(Sid: 1) Server -> Client : 1990 bytes (Service=HTTP)
"GET /img/baidu_logo.gif"
(Sid: 1) Client -> Server : 457 bytes (Service=HTTP)
(Sid: 1) Server -> Client : 1779 bytes (Service=HTTP)
Address lookup for test75 = 10.10.10.1
Request Connection: Remote Server @ 220.181.5.21:80 (Service=) (Sid= 2) PROXIED!
"GET /img/gs.gif"
(Sid: 2) Client -> Server : 450 bytes (Service=HTTP)
"GET /js/bdsug.js?v=1.0.1.0"
(Sid: 1) Client -> Server : 460 bytes (Service=HTTP)
(Sid: 1) Server -> Client : 2581 bytes (Service=HTTP)
(Sid: 2) Server -> Client : 369 bytes (Service=HTTP)
(Sid: 2) Connection Terminated (by Server)
其中發出總數為:1774
接收字節總數為:6927
那么loadrunner運行后,Throughput記錄的是發出的字節數呢還是接收的字節數呢,或者還是兩者之和呢?我們接下來繼續做!
3、在run time setting中設置該腳本運行10次
也就是說發送總字節數為17740,接收總字節數為69270
4、在Controller中運行該腳本,場景運行模式設置為:Classic schedule
start vusers設置為:simultaneously
duration設置為:run until completion
5、我們預計一下運行該場景的結果,其中吞吐量的數值應該是69270就證明了我們說法
6、運行場景
7、場景運行完成后,點擊analysis results生成分析結果報表
Analysis Summary Period: 16/02/2009 15:51:55 - 16/02/2009 15:52:08
Scenario Name: Scenario1
Results in Session: C:\Documents and Settings\test\My Documents\lr_http\res\res.lrr
Duration: 13 seconds.
Statistics Summary
Maximum Running Vusers: 1
Total Throughput (bytes): 69,270 (
與接受到的總字節數一樣)
Average Throughput (bytes/second): 4,948
Total Hits: 40
Average Hits per Second: 2.857 View HTTP Responses Summary
總結:loadrunner中Total Throughput (bytes)所統計數量是,在整個測試過程中,從服務器返回給客戶端的所有字節數,與發送請求的字節數無關!
版權聲明:本文為博主原創文章,未經博主允許不得轉載。