使用Visual Studio Profiler测试host在本地IIS上的WCF服务性能

来源:博客园 作者:Mike Dos Zhang 发表时间:2012-01-09 09:56 点击:获取本文网址二维码
读过上篇bolg的现在应该知道怎么样来Profile一个WCF项目了,今天我们来看一下怎样Profile一个host到本地IIS上的WCF服务,我们还是使用Visual Studio 2010还有上篇blog中的测试项目。 使用Administrator账户启动Visual Studio 2010!

  http://www.cnblogs.com/telnet_mike/archive/2011/11/07/2240351.html

  读过上篇bolg的现在应该知道怎么样来Profile一个WCF项目了,今天我们来看一下怎样Profile一个host到本地IIS上的WCF服务,我们还是使用Visual Studio 2010还有上篇blog中的测试项目。

  使用Administrator账户启动Visual Studio 2010!

  How to: Host a WCF Service in IIS

  Deploying an Internet Information Services-Hosted WCF Service

  Using Visual Studio 2010 to Host a WCF Service on the Local IIS Instance

  Open or create a WCF Service Application project. Right click the project in the solution explorer and select Properties. In the project properties window select the Web tab on the left hand side of the window. On the right hand side of the window, under Servers, select the Use Local IIS Web Server and type in a URL. Next, click the Create Virtual Directory button and build the solution. This will create the virtual directory in IIS and map it to your project directory. The service will then be hosted on the local IIS server for building and debugging purposes. To verify the service has been hosted, open Internet Explorer and type the service’s URL in the address box. You must type in the complete URL path to the .svc file. For example, with a default WCF Service Application project hosted under http://localhost/MyFirstService the complete URL would be http://localhost/MyFirstService/Service1.svc. This will display the default WCF Service page.

hostWCF2LocalIIS

  使用同样的步骤将我们的WebApplication1 asp.net应用程序项目也host到本地IIS上。

  WcfService1地址: http://localhost/WcfService1/Service1.svc

  WebApplication1地址: http://localhost/WebApplication1

proformancewizard1_4
proformancewizard2_4
proformancewizard3_4
proformancewizard4_4

  IE会直接打开WCF服务的页面:

WcfService1

  现在我们可以用WebApplication1地址来替换WcfService1地址,并让IE浏览它,这样我们可以使用我们的asp.net应用来调用WcfService1中的函数,从而达到测试性能的目标。

testpage

  报表会在你关闭IE的时候,Visual Studio Profiler工具停止后,自动打开。

report1

  你可以看到所有的函数调用,但你点击WcfService1.Service1.Abc(int32)函数后,它会为你打开一个详细页面和你的函数源代码。

sourcecode

  My English Blog: http://mikedoszhang.blogspot.com/2011/11/profile-wcf-which-hosted-in-local-iis.html

转播到腾讯微博
填写您的邮件地址,订阅我们的精彩内容:
微博分享与邮件订阅:

    您可能感兴趣的文章  (亲!如果本文有错误,请来挑错)


    本文标题:使用Visual Studio Profiler测试host在本地IIS上的WCF服务性能
    http://www.ltesting.net/ceshi/ceshijishu/rjcsgj/qita/vsts/2012/0109/203882.html
    (注:本文章只代表作者观点。部分文章内容来自于互联网,如您享有版权可直接联系我们。欢迎登陆领测软件测试论坛参与讨论)
    官方微博求关注:官方新浪微博 官方腾讯微博 官方QQ空间 官方博客 热门推荐订阅 填写您的邮件地址,订阅我们的精彩内容:

    软件测试视频

  • 讲解软件测试流程图
  • 讲解软件测试流程图

    软件测试整体过程 单元测试过程图 集成测试过程图 系统测试过程图 软件[详细]

  • 什么是黑盒,白盒,灰盒测试?
  • 什么是黑盒,白盒,灰盒测试?

    什么是黑盒测试? 黑盒测试一般方法? 什么是白盒测试? 什么是灰盒测试?[详细]

    社区精华

    qrcode

    二维码生成需要几秒~点击左键返回页面~!
    什么是二维码?


    _×
    推荐新闻