自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

如何在VSTS 2010中自定義真實網(wǎng)絡仿真

開發(fā)
在前面幾篇博客文章里,我們介紹了VSTS 2010 網(wǎng)絡仿真,以及如何為負載測試或單元測試及其它測試配置網(wǎng)絡仿真(Network Emulation)。接下來的一些博客中將陸續(xù)與大家分享在使用VS2010過程中發(fā)現(xiàn)的關(guān)于 Network Emulation 網(wǎng)絡仿真更高級的特性。

mso-hansi-font-family: Verdana" lang=ZH-CN>中網(wǎng)絡仿真(Network Emulation)新特性

VS20008 相比,VS2010提供的網(wǎng)絡仿真(Network Emulation可以模擬那些使用可靠的物理鏈路的有線和無線網(wǎng)絡,如以太網(wǎng)。并且VS2010里提供的網(wǎng)絡仿真模型中加入了許多新的網(wǎng)絡屬性:如跨網(wǎng)絡的往返時間(延遲)Latency、 可用帶寬、 排隊方式、 數(shù)據(jù)包丟失量、 數(shù)據(jù)包的重新排列和錯誤傳播等,并為篩選基于 IP 地址或TCP、 UDP ICMP協(xié)議的網(wǎng)絡數(shù)據(jù)包提供了靈活性。因此與VS2008相比,VS2010網(wǎng)絡仿真為用戶模擬出更真實的網(wǎng)絡環(huán)境。

VSTS 2010中提供下列10 種網(wǎng)絡類型:

◆Cable-DSL 384Kps

 Test simulating LAN

◆Cable-DSL 1.5Mbps

◆Cable-DSL 768Kbps 

◆ 3G

◆CDMA

◆Dial-up 56k Modem

◆ Intercontinental slow WAN 300 Kbps

◆Intercontinental slow WAN 1.5 Mbps

◆Intra-continental slow WAN 1.5 Mbps

自定義 mso-hansi-font-family: Verdana" lang=ZH-CN>中網(wǎng)絡仿真配置文件(Network Emulation Profile)

VS2010中自有的網(wǎng)絡仿真配置文件位于:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Templates\LoadTest\Networks

例如:VSTS 201 中新提供的3G網(wǎng)絡定義如下:

  1. <NetworkEmulationProfile name="3G" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> 
  2. <Emulation> 
  3.   <VirtualChannel name="ThreeG-Channel1"> 
  4.     <FilterList /> 
  5.     <VirtualLink instances="1" name="link1"> 
  6.       <LinkRule dir="upstream">?。瘜拵滦兴俣榷x  
  7.         <Bandwidth>    
  8.           <Speed unit="kbps">512</Speed> 
  9.           <QueueManagement>       //數(shù)據(jù)包排隊方式定義  
  10.             <NormalQueue> 
  11.               <Size>100</Size> 
  12.               <QueueMode>packet</QueueMode> 
  13.               <DropType>DropTail</DropType> 
  14.             </NormalQueue> 
  15.           </QueueManagement> 
  16.         </Bandwidth> 
  17.         <Latency>    //延遲定義  
  18.           <Fixed> 
  19.             <Time unit="msec">150</Time> 
  20.           </Fixed> 
  21.         </Latency> 
  22.         <Loss>       //數(shù)據(jù)包丟失定義  
  23.           <Random> 
  24.             <Rate>0.0025</Rate> 
  25.           </Random> 
  26.         </Loss> 
  27.       </LinkRule> 
  28.       <LinkRule dir="downstream">?。瘜拵闲兴俣榷x  
  29.         <Bandwidth> 
  30.           <Speed unit="kbps">64</Speed> 
  31.           <QueueManagement>  ?。瘮?shù)據(jù)包排隊方式定義  
  32.            <NormalQueue> 
  33.              <Size>100</Size> 
  34.               <QueueMode>packet</QueueMode> 
  35.               <DropType>DropTail</DropType> 
  36.             </NormalQueue> 
  37.           </QueueManagement> 
  38.         </Bandwidth> 
  39.         <Latency>    //延遲定義  
  40.          <Fixed> 
  41.             <Time unit="msec">150</Time> 
  42.           </Fixed> 
  43.         </Latency> 
  44.         <Loss>   ?。瘮?shù)據(jù)包丟失定義  
  45.           <Random> 
  46.            <Rate>0.0025</Rate> 
  47.           </Random> 
  48.         </Loss> 
  49.       </LinkRule> 
  50.     </VirtualLink> 
  51.   </VirtualChannel> 
  52. </Emulation> 
  53. </NetworkEmulationProfile> 

用戶可以很容易地根據(jù)自己的需求自定義并創(chuàng)建所需要模擬的網(wǎng)絡環(huán)境:

1. 為網(wǎng)絡屬性如網(wǎng)絡延遲(Latency)、寬帶上行/下行速度、 數(shù)據(jù)包排隊方式、 數(shù)據(jù)包丟失設置相應的 

2.更改NetworkEmulationProfile名字為自定義網(wǎng)絡類型名字

3.將自定義的network文件放置在: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Templates\LoadTest\Networks

當我們運行Unit/Load Test 時,就可以利用自定義的網(wǎng)絡類型進行網(wǎng)絡模擬:

Configuration Settings – localtestsettings 頁中的網(wǎng)絡模擬列出了我們自定義創(chuàng)建的網(wǎng)絡類型:

VSTS2010界面

Load Test Wizard的網(wǎng)絡組合里列出了我們自定義創(chuàng)建的網(wǎng)絡類型

界面

以后的博客中將分享更多的網(wǎng)絡模擬高級特性,包括對網(wǎng)絡數(shù)據(jù)包的排隊方式、 數(shù)據(jù)包丟失量、 數(shù)據(jù)包的重新排列和錯誤傳播等,以及篩選基于 IP 地址或TCP、 UDP ICMP協(xié)議的網(wǎng)絡數(shù)據(jù)包進行模擬。

【編輯推薦】

  1. 用VSTS代碼驗證工具捕捉C/C++錯誤
  2. VSTS 編寫測試Test技巧
  3. 全職殺手:用VSTS2010進行軟件生命周期管理
  4. 用VSTS代碼驗證工具捕捉C/C++錯誤
  5. 自定義VSTS開發(fā)流程
責任編輯:彭凡 來源: pcdog.com
相關(guān)推薦

2019-12-02 21:29:45

Keras神經(jīng)網(wǎng)絡TensorFlow

2021-07-01 11:07:49

Swift 自定義操作符

2021-07-16 11:00:40

Django用戶模型Python

2010-12-28 16:10:06

Exchange 20

2009-06-23 14:54:07

配置ControlleVSTS2010

2017-06-20 12:48:55

React Nativ自定義模塊Note.js

2013-03-28 16:59:56

Android開發(fā)自定義TitleBar

2011-08-09 17:16:56

CoreAnimati動畫

2021-11-23 15:06:42

Kubernetes 運維開源

2018-03-02 13:13:21

2024-05-08 17:05:44

2019-06-21 09:50:47

Windows 10自定義分辨率

2010-12-31 10:21:03

Office 2010自定義安裝

2021-03-16 10:39:29

SpringBoot參數(shù)解析器

2017-12-05 08:50:51

2011-06-15 09:24:36

Qt Widget Model

2009-09-07 22:00:15

LINQ自定義

2010-02-25 16:14:51

Visual Stud

2010-03-18 15:10:54

VSTS 2010CodedUI Tes

2013-06-27 11:10:01

iOS開發(fā)自定義UISlider
點贊
收藏

51CTO技術(shù)棧公眾號