How to: Configure ASP.NET profiler for load tests using test settings in Visual Studio

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can use the ASP.NET profiler diagnostic data adapter to collect ASP.NET profiler information. This diagnostic data adapter collects performance data for ASP.NET applications.

Note

Web performance and load test functionality is deprecated. Visual Studio 2019 is the last version where web performance and load testing will be fully available. For more information, see the Cloud-based load testing service end of life blog post. To reduce the impact on users some minimum support is still available in Visual Studio 2022 Preview 3 or later. Users should also note web performance and load test functionality only supports Internet Explorer which is not available on Windows 11 and some versions of Windows 10. Read more on Internet Explorer Lifecycle policy.

Note

This diagnostic data adapter cannot be used for tests that are run using Microsoft Test Manager (deprecated in Visual Studio 2017). You can use the ASP.NET Profiler diagnostic adapter with load tests using websites only, which requires Visual Studio Enterprise.

The ASP.NET profiler diagnostic data adapter lets you collect ASP.NET profiler data from the application tier when you run a load test. You should not run the profiler for long load tests, for example, load tests that run longer than one hour. This is because the profiler file can become large, perhaps hundreds of megabytes. Instead, run shorter load tests by using the ASP.NET profiler, which will still give you the benefit of deep diagnosis of performance problems.

Note

The ASP.NET profiler diagnostic data adapter profiles the Internet Information Services (IIS) process. Therefore, it will not work against a development web server. To profile the website in your load test, you have to install a test agent on the machine on which the IIS is running. The test agent will not generate load, but will be an agent for collection only. For more information, see Install and configure test agents.

For more information, see How to: Create a test setting for a distributed load test.

Configure the ASP.NET profiler for your test settings

Before you perform the steps in this procedure, you must open your test settings from Visual Studio and select the Data and Diagnostics page.

  1. Select the role to use to collect the ASP.NET profiler data.

    Warning

    This role must be a web server.

  2. Select ASP.NET Profiler to enable collecting ASP.NET profiling data, and then choose Configure.

    The dialog box to configure ASP.NET profiling data collection is displayed.

  3. In Profiler Sampling interval, type a value that indicates how many non-halted CPU clock cycles to wait between taking ASP.NET profiling samples.

  4. To enable tier interaction profiling, select Enable Tier Interaction Profiling.

    Tier interaction profiling counts the number of requests that are sent to the web server for each artifact (for example, MyPage.aspx or CompanyLogo.gif) and the time it took to service each request. Additionally, tier interaction profiling collects which ADO.NET connections were used as a part of the page request, and how many queries and stored procedure calls were executed as a part of servicing that request.

    Two different sets of timing information are collected:

    • The timing information (Min, Max, Average, and Total) for servicing each web request.

    • The timing information (Min, Max, Average and Total) of executing each query.

With the ASP.NET profiler diagnostic data adapter configured in your test setting, you can now collect ASP.NET profiling data on your ASP.NET web application.

See also