<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Load Test and Beyond</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/edwinh/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/edwinh/feed.xml</link>
    <description>Findings, Gotchas and other useful information about Load testing, app optimization and functional automation</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:40:08 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Using Relog.exe to Import Perfmon logs into a SQL Database, then use Excel Pivot Charts!</title>
      <link>https://docs.microsoft.com/archive/blogs/edwinh/using-relog-exe-to-import-perfmon-logs-into-a-sql-database-then-use-excel-pivot-charts</link>
      <pubDate>Mon, 07 Nov 2016 15:49:29 GMT</pubDate>
      <dc:creator><![CDATA[Edwin_Hernandez (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/edwinh/?p=135</guid>
      <description><![CDATA[I have recently come across a scenario where a customer needs me to run a Performance Test of an...]]></description>
      <content:encoded><![CDATA[I have recently come across a scenario where a customer needs me to run a Performance Test of an Application but due security policies is not able (or doesn't want) to provide Server-Level access to the Servers where the Application is hosted. Without the access a Visual Studio Load Test will not able to collect performance metrics from the target servers. What I normally do here is to request that the customer gets someone who does have access to run a Perform Data Collection while the Performance test is running and then send me the .BLG file(s) for analysis.

The analysis can be done directly on PERFMON by loading the .blg file, dragging the various counters to the chart and doing actions like comparisons, looking for threshold violations, etc. However, if what you need is to create nice-looking charts, overlay counters, pie charts, etc. for a report, then you probably need something better that PERFMON charts.

In the following steps I will show you how to load the PERFMON .blg files into a SQL Database and then pull data from the SQL Database into an Excel pivot chart. I base this information on a 2012 blog-post by Prashant Kumar <a href="https://sqlactions.com/2012/05/15/collection-and-reporting-of-perfmon-data-for-sql-server-capacity-planning-and-trend-analysis/">here</a>, although I am updating it by using PowerShell to provide better maintainability and Pivot charts on Excel 2016:
<ul>
 	<li>Prerequisite: Create a PERFMON log file (.blg) by running a trace in a server, to do this you need to create a Perfmon Data Collection Set, there are a few templates by default or you can create or lookup a specific template. Once created you need to run the Data Collection for an given amount of time (e.g. 30min while a Load Test is running). Here is some additional information from <a href="https://technet.microsoft.com/en-us/library/cc722148(v=ws.11).aspx">TechNet</a>.</li>
 	<li>Optionally: Once you have one or several .blg files, you can join them together into a single .blg file for easier handling, or you can chose to keep them separate. For this you can use relog.exe, it's important to point out that you can use relog.exe from the Command Prompt console, or you can use a PowerShell script as follows for easier editing of the attributes and local paths:</li>
</ul>
<a href="https://blogs.msdn.microsoft.com/edwinh/2016/11/07/using-relog-exe-to-import-perfmon-logs-into-a-sql-database-then-use-excel-pivot-charts/relog1/"><img width="675" height="601" class="aligncenter wp-image-145" alt="########################################## #                                        # # COMBINE BLG FILES INTO SINGLE BLG # #                                        # ##########################################   $blgFile1 = &quot;C:\Logs\DataCollection1.blg&quot; $blgFile2 = &quot;C:\Logs\DataCollection1.blg&quot; $combinedFile = &quot;C:\Logs\DataCollection_Combined.blg&quot; $AllArgs =  @($blgFile1,$blgFile2,  '-f', 'bin', '-o',  $combinedFile) &amp; 'relog.exe' $AllArgs" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog1.png" /></a>
<ul>
 	<li class="wp-caption-dd">Step 1: You will need to create a new database in SQL (e.g. PerfmonDB). For this example I'm using SQL Server 2016, I have also successfully loaded Perfmon data to a SQL 2012 database.
<ul>
 	<li class="wp-caption-dd">Note: SQL Express editions do not work since it you would need to create the ODBC connection thru the SQL Native client (to localDB) and that will create problems with relog.exe since it won't recognize the DSN source.</li>
</ul>
</li>
 	<li class="wp-caption-dd">Step 2: Create a SQL Server ODBC- System DSN source named Perfmon_DSN that points to your SQL Server and Database
<ul>
 	<li class="wp-caption-dd">To create the ODBC-System DNS connection:
<ul>
 	<li class="wp-caption-dd">Run odbcad32.exe, go to the System DSN tab and click on 'Add' to add a new Source</li>
 	<li class="wp-caption-dd">Select SQL Server (not native client) and type the connection configuration details (e.g. Name: Perfmon_DSN, Description: Perfmon, Server: &lt;yourSQLServer&gt;)</li>
 	<li class="wp-caption-dd">Preferably chose NT Authentication and change the default database to PerfmonDB, keep all other defaults.</li>
</ul>
</li>
</ul>
</li>
</ul>
<img width="901" height="349" class="aligncenter wp-image-165" alt="relog2" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog2.png" />
<ul>
 	<li class="wp-caption-dd">Step 3: Use relog.exe to load the combined, or single .blg file into the SQL database thru your DNS connection.
<ul>
 	<li class="wp-caption-dd">To do this you can run relog.exe from PowerShell as shown on the code below.</li>
</ul>
</li>
</ul>
<a href="https://blogs.msdn.microsoft.com/edwinh/2016/11/07/using-relog-exe-to-import-perfmon-logs-into-a-sql-database-then-use-excel-pivot-charts/relog3/"><img width="671" height="593" class="aligncenter wp-image-175" alt="########################################## #                                        # # IMPORT BLG FILES INTO SQL DATABASE # #                                        # ##########################################   $sourceBlg = &quot;C:\Logs\DataCollection_Combined.blg&quot; $sqlDSNconection = &quot;SQL:Perfmon_DSN!logfile&quot; $AllArgs =  @($sourceBlg, '-f', 'SQL', '-o', $sqlDSNconection) &amp; 'relog.exe' $AllArgs" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog3.png" /></a>
<ul>
<ul>
 	<li class="wp-caption-dd">You can validate that the script worked by checking your PerfmonDB database. Tables CounterData, CounterDetails and DisplayToId should have been created.</li>
</ul>
 	<li class="wp-caption-dd">Step 4. Now that the data has been loaded into the SQL Database, we can start working in pulling it into Excel reporting purposes. Let's do the Connection/Query first:
<ul>
 	<li class="wp-caption-dd">You will need Excel (I'm using 2016 for this example).</li>
 	<li class="wp-caption-dd">First you need to create a connection. In a new Spreadsheet, go to Data &gt; Get External Data &gt; From Other Sources &gt; From SQL Server.
<ul>
 	<li class="wp-caption-dd">Type your SQLServer name and log on credentials.</li>
 	<li class="wp-caption-dd">Select your database PerfmonDB, there is no need to specify a default table just click next and then finish.</li>
 	<li class="wp-caption-dd">Cancel the select table dialog.</li>
</ul>
</li>
 	<li class="wp-caption-dd">Now that you have a connection, you need a proper SQL query that pulls only the information that you need.
<ul>
 	<li class="wp-caption-dd">In excel, go to Data &gt; Connections, select your connection and click Properties.</li>
 	<li class="wp-caption-dd">Go to the Definition tab and in Command Type, select SQL</li>
 	<li class="wp-caption-dd">Under Command Text copy the SQL query below and click the OK button. On the query, the interval is set at every 1 minute, you can tweak that according to your needs (e.g. every 1hr), also this query will pull all objects imported from the Perfmon logs, if it is too much information you can always filter out in the WHERE clause by adding (for example): AND objectname = 'Processor'.</li>
</ul>
</li>
</ul>
</li>
</ul>
<a href="https://blogs.msdn.microsoft.com/edwinh/2016/11/07/using-relog-exe-to-import-perfmon-logs-into-a-sql-database-then-use-excel-pivot-charts/relog4/"><img width="830" height="499" class="aligncenter wp-image-185" alt="SELECT counterdetails.machinename,        counterdetails.objectname,        counterdetails.countername,        counterdetails.countertype,        counterdetails.instancename,        Datediff(minute, st.starttime, Cast(LEFT(counterdata.counterdatetime, Len(counterdata.counterdatetime) - 5) AS DATETIME)) AS interval,        Avg(counterdata.countervalue)        AS counterValues FROM   counterdata        INNER JOIN counterdetails                ON counterdata.counterid = counterdetails.counterid,        (SELECT counterdetails.machinename,                Min(Cast(LEFT(counterdata.counterdatetime, Len(                         counterdata.counterdatetime) - 5)                         AS                             DATETIME))AS startTime         FROM   counterdata                INNER JOIN counterdetails                        ON counterdata.counterid = counterdetails.counterid         GROUP  BY machinename) AS st WHERE  st.machinename = counterdetails.machinename GROUP  BY counterdetails.machinename,           counterdetails.objectname,           counterdetails.countername,           counterdetails.countertype,           counterdetails.instancename,           Datediff(minute, st.starttime, Cast(LEFT(counterdata.counterdatetime, Len(counterdata.counterdatetime) - 5)  AS DATETIME)),           counterdata.countervalue  " src="https://msdnshared.blob.core.windows.net/media/2016/11/relog4.png" /></a>
<ul>
 	<li class="wp-caption-dd">Step 5 - Let's use the query results to build a Pivot Table and Charts
<ul>
 	<li class="wp-caption-dd">First go to Insert &gt; Charts &gt; PivotChart &gt; PivotChart &amp; PivotTable</li>
 	<li class="wp-caption-dd">In the Create Pivot Table dialog, select "Use External Data Source" and "New Worksheet". Click ok.</li>
 	<li class="wp-caption-dd">That should show you an empty Table, empty Chart and the PivotTable Fields Selector. In the Selector, use the configuration shown below. Basically you need the <span style="text-decoration: underline">internal</span> field in the Rows area, the <span style="text-decoration: underline">counterValues</span> in the Values area and all other fileds in the Columns area.
<ul>
 	<li class="wp-caption-dd">Note: For the <span style="text-decoration: underline">counterValues</span> field you need to summarize the value field by average. To do this right-click in the <u>counterValues</u> field and go to Properties, then from the list select Average.<img width="329" height="675" class="aligncenter wp-image-195" alt="relog5" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog5.png" /></li>
</ul>
</li>
 	<li class="wp-caption-dd">Now you should have all the information you need for the Charts, however it may have too many objects, counters, or Machines for the chart to make sense. In the table use the Column Labels filters to chose only the objects that you need. Please note that you can change the field on top of the picture below in the Select field dropdown:<img width="229" height="282" class="aligncenter wp-image-205" alt="relog6" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog6.png" /></li>
 	<li class="wp-caption-dd">A much more rewarding way to do this is by adding Slicers. To do this, in excel go to PivotTable Tools &gt; Analyze &gt; Filter &gt; Insert Slicer, then select the counter(s) that you need for easier filtering. It should look something like this:<img width="1647" height="1271" class="aligncenter size-full wp-image-206" alt="relog7" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog7.png" /></li>
 	<li class="wp-caption-dd">Now you can play around with selecting one or more combinations of Machine/Object/Instance and Counter. You can do multi-select with the button on top of each selector.
<ul>
 	<li class="wp-caption-dd">Keep in mind that not all Counters have an Instance.</li>
</ul>
</li>
 	<li class="wp-caption-dd">Using the selectors and some formatting on the Chart, you should be able to easily come up with a Chart similar to the one below:<img width="1911" height="1397" class="aligncenter size-full wp-image-215" alt="relog8" src="https://msdnshared.blob.core.windows.net/media/2016/11/relog8.png" /></li>
</ul>
</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>VS Load Test - Hierarchy of test metrics: Request/Page/Transaction/Test counters</title>
      <link>https://docs.microsoft.com/archive/blogs/edwinh/vs-load-test-hierarchy-of-test-metrics-requestpagetransactiontest-counters</link>
      <pubDate>Tue, 06 Sep 2016 14:41:31 GMT</pubDate>
      <dc:creator><![CDATA[Edwin_Hernandez (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/edwinh/?p=115</guid>
      <description><![CDATA[When doing performance testing, one of the main metrics used to evaluate how the system is doing is...]]></description>
      <content:encoded><![CDATA[When doing performance testing, one of the main metrics used to evaluate how the system is doing is throughput, throughput is the amount of traffic per time that the system is accepting. As throughput goes up, the system resource utilization also goes up, as well as the response times, at least at first. In Visual Studio throughput can be measured at a few different levels, and depending on what you are looking for and you unique system and test harness you may be using: passed tests per second, requests per second, transactions per second, etc.

Let's start by defining the 4 counters used by Visual Studio to measure traffic:

<b>Test: </b>Visual studio measures the elapsed time of one Webtest iteration, from start to finish, including everything inside. It includes  think time (if enabled) and any processing time from Plugins (although this is sometimes negligible).

<b>Transaction: </b>Transactions are used defined, they should be used to group pages and requests into a logical group that is useful for result analysis. I normally use this to group all pages and requests that are part of a business step, for example, the "Submit Login information", my transaction would include everything that got recorded from the Submit Login until the browser completes loading all resources.

<b>Page</b>: The page counter measures the time it takes to load all resources (including items not explicitly listed on the webtest) for a Page. For example a default.html, may include other content that gets downloaded behind the scenes such as CSS, images, Java Scripts, etc.

<b>Request: </b>Requests are individual request made during a webtest down to the lowest level, it includes CSS, png, jpg, gif, manifests, Java Scripts, etc.

&nbsp;

You may already have guesses, but the <span style="color: #000000;font-family: Segoe UI">hierarchy for these metrics normally goes like this: a test (webtest) </span><span style="color: #000000;font-family: Segoe UI">should normally have several </span><span><span style="font-family: Segoe UI">transactions in it (transactions are used defined, so a test could have 0 transactions, which is not a good practice), </span></span><span style="color: #000000;font-family: Segoe UI">each transaction should have at least 1 </span><span><span style="font-family: Segoe UI">page </span></span><span style="color: #000000;font-family: Segoe UI">call, and inside each page call there should be one or multiple http </span><span><span style="font-family: Segoe UI">requests. This graph may help visualizing it:</span></span>

<img width="415" height="435" class="alignnone wp-image-125" alt="hie" src="https://msdnshared.blob.core.windows.net/media/2016/09/hie.png" />]]></content:encoded>
    </item>
    <item>
      <title>Create custom Perfmon counters and update them from a CSV file using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/edwinh/create-custom-perfmon-counters-and-update-them-from-a-csv-file-using-powershell</link>
      <pubDate>Mon, 25 Apr 2016 14:10:44 GMT</pubDate>
      <dc:creator><![CDATA[Edwin_Hernandez (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/edwinh/?p=85</guid>
      <description><![CDATA[Adding Perfmon counters to a Visual Studio load test is useful to monitor remote host's metrics such...]]></description>
      <content:encoded><![CDATA[Adding Perfmon counters to a Visual Studio load test is useful to monitor remote host's metrics such a usage of Processor, Memory or Local Disks. You can add these metrics to a graph and overlay Load Test metrics such as throughput or response times for analysis.

When you have third party applications that need to be monitored, such as a program causing load on the 'system under test'. It can be useful to add these metrics to the VS Load test graphs in the form of custom Perfmon counters.

One of the easiest ways I have found so far of creating Perfmon counters is described on this article by Michael Repperger: <a href="https://blogs.technet.com/b/omx/archive/2014/04/23/use-powershell-to-create-and-update-performance-counters.aspx">article</a>.

The program in question that is causing load to the system is also producing a CSV log, using Michael's sample and then using the <a href="https://technet.microsoft.com/en-us/library/hh849891.aspx" target="_blank">import-csv</a> cmdlet, we can consume the csv log and update Perfmon counters.

These the counters can be added to Counter Sets on Visual Studio and once a Load Test is running the new metrics would get collected and they can be used for analysis.

Below is a sample PowerShell script:

<hr />

<blockquote>
<h6><span style="color: #808080">$categoryName = "UI Scripts"</span></h6>
<h6><span style="color: #808080">$categoryHelp = "Transaction Response Times for UI Scripts"</span></h6>
<h6><span style="color: #808080">$categoryType = [System.Diagnostics.PerformanceCounterCategoryType]::MultiInstance</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">$categoryExists = [System.Diagnostics.PerformanceCounterCategory]::Exists($categoryName)</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">If (-Not $categoryExists)</span></h6>
<h6><span style="color: #808080">{</span></h6>
<h6><span style="color: #808080">  $objCCDC = New-Object System.Diagnostics.CounterCreationDataCollection</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">  $objCCD1 = New-Object System.Diagnostics.CounterCreationData</span></h6>
<h6><span style="color: #808080">  $objCCD1.CounterName = "Transaction Response Time"</span></h6>
<h6><span style="color: #808080">  $objCCD1.CounterType = "NumberOfItems32"</span></h6>
<h6><span style="color: #808080">  $objCCD1.CounterHelp = "Duration in Miliseconds of a UI transaction"</span></h6>
<h6><span style="color: #808080">  $objCCDC.Add($objCCD1) | Out-Null</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">  [System.Diagnostics.PerformanceCounterCategory]::Create($categoryName, $categoryHelp, $categoryType, $objCCDC) | Out-Null</span></h6>
<h6><span style="color: #808080">}</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">$perfInst1a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction1", $false)</span></h6>
<h6><span style="color: #808080">$perfInst2a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction2", $false)</span></h6>
<h6><span style="color: #808080">$perfInst3a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction3", $false)</span></h6>
<h6><span style="color: #808080">$perfInst4a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction4", $false)</span></h6>
<h6><span style="color: #808080">$perfInst5a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction5", $false)</span></h6>
<h6><span style="color: #808080">$perfInst6a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction6", $false)</span></h6>
<h6><span style="color: #808080">$perfInst7a = New-Object System.Diagnostics.PerformanceCounter($categoryName, "Transaction Response Time", "Transaction7", $false)</span></h6>
&nbsp;
<h6><span style="color: #808080">$checkIfSame1 = ""</span></h6>
<h6><span style="color: #808080">for ($i = 1; $i -lt 100000; $i++){</span></h6>
<h6><span style="color: #808080">    $timings = import-csv "C:\Users\edwinh\Desktop\test.csv"</span></h6>
<h6><span style="color: #808080">    $checkIfSame2 = $timings[$timings.Length-1].'Transaction1,' -as[int]</span></h6>
<h6><span style="color: #808080">    If($checkIfSame1 -ne $checkIfSame2){</span></h6>
<h6><span style="color: #808080">        $perfInst1a.RawValue = $timings[$timings.Length-1].'Transaction1' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst2a.RawValue = $timings[$timings.Length-1].'Transaction2' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst3a.RawValue = $timings[$timings.Length-1].'Transaction3' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst4a.RawValue = $timings[$timings.Length-1].'Transaction4' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst5a.RawValue = $timings[$timings.Length-1].'Transaction5' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst6a.RawValue = $timings[$timings.Length-1].'Transaction6' -as[int]</span></h6>
<h6><span style="color: #808080">        $perfInst7a.RawValue = $timings[$timings.Length-1].'Transaction7' -as[int]</span></h6>
<h6><span style="color: #808080">    }</span></h6>
<h6><span style="color: #808080">    $checkIfSame1 = $checkIfSame2 </span></h6>
<h6><span style="color: #808080">Start-Sleep -s 2</span></h6>
<h6><span style="color: #808080">}</span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080"> </span></h6>
<h6><span style="color: #808080">Read-Host</span></h6>
<h6><span style="color: #808080"> </span></h6>
</blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Guide to get started with Visual Studio Web Load Testing and Automation</title>
      <link>https://docs.microsoft.com/archive/blogs/edwinh/guide-to-get-started-with-visual-studio-web-load-testing-and-automation-2</link>
      <pubDate>Thu, 21 Apr 2016 14:56:00 GMT</pubDate>
      <dc:creator><![CDATA[Edwin_Hernandez (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/edwinh/?p=45</guid>
      <description><![CDATA[Applies to VS 2015 but other versions mentioned.

This article provides consolidated information...]]></description>
      <content:encoded><![CDATA[Applies to VS 2015 but other versions mentioned.

This article provides consolidated information in a concise presentation for anyone who wants to start a web load test project using Visual Studio. You may have noticed that there is plenty of information on MSDN and visualstudio.com that tells you about cloud testing/on premises requirements, agents, controllers, webtests, plugins, etc.

The amount of information can be easily overwhelming, this article can be used as a starting guide for newcomers to understand the basic setup and to find the best route into achieving the results desired.
<h2>1. Software Requirements. Versions and licenses</h2>
<h4>Visual Studio</h4>
<p style="padding-left: 30px">The first thing you will need is Visual Studio. The Web Load &amp; Performance Testing features of Visual studio are only available on versions: <span style="text-decoration: underline">Visual Studio Enterprise 2015</span> or <span style="text-decoration: underline">Visual Studio Ultimate 2013</span>.</p>
<p style="padding-left: 30px">Other type of tests such as Coded UI, Manual tests and Unit testing are also available on <span style="text-decoration: underline">Visual Studio Test Professional 2015</span> however these are all functional tests. We'll focus on performance web tests for now, this is NOT available on VS Test Professional. You can find a feature comparison among VS versions here: <a href="https://www.visualstudio.com/en-us/products/compare-visual-studio-2015-products-vs.aspx">Compare Visual Studio 2015 Offerings</a>.</p>

<h4>Virtual User Licenses</h4>
<p style="padding-left: 30px"><strong>On premises. </strong>No virtual user licenses are needed. You can execute load tests with any number of virtual users (as far as your hardware resources allow you) as long as you have any of the following:</p>
<p style="padding-left: 60px">- Visual Studio Enterprise 2015 with MSDN</p>
<p style="padding-left: 60px">- Visual Studio Enterprise 2015 annual and monthly subscribers (check <a href="https://www.microsoft.com/en-us/download/confirmation.aspx?id=13350">Visual Studio 2015 Licensing White Paper</a>)</p>
<p style="padding-left: 60px">- Visual Studio Ultimate 2013 with MSDN (check <a href="https://www.microsoft.com/en-us/download/details.aspx?id=13350">Visual Studio 2013 Licensing White Paper</a>)</p>
<p style="padding-left: 60px">* In Visual Studio Enterprise (or Ultimate) <strong>trial</strong> version, the virtual user count is limited to 250.</p>
<p style="padding-left: 30px"><strong>Cloud-Based testing.</strong> No extra software installation needed. You do need:</p>
<p style="padding-left: 60px">- A Visual Studio Online (VSO) account (<a href="https://www.visualstudio.com/get-started/setup/sign-up-for-visual-studio-online">get one here</a>).</p>
<p style="padding-left: 60px">- That gets you 20,000 virtual user minutes every month to load test at no extra charge (check how virtual users minutes work and test duration limitations here: <a href="https://www.visualstudio.com/get-started/test/load-test-your-app-vs#VUM">VSO Virtual users minutes</a>).</p>

<h4>Controller and Agents Software</h4>
<p style="padding-left: 30px"><strong>On premises. </strong>If you are planning to load test an application in an on-premises environment, you will need a Controller and at least 1 agent machine (check next section for hardware requirements). You can find the installable software for these two components based on your Visual studio version here:</p>
<p style="padding-left: 60px"><a href="https://go.microsoft.com/fwlink/p/?LinkId=619266">- Download Agents for Microsoft Visual Studio 2015</a>  - <b>Update: Don't use the Test Agents for VS 2015 for load testing. It is meant for continuous tests on build scenarios, it doesn't have a test controller or a configuration tool. Instead use VS Test Agents 2013 Update 5:</b></p>
<p style="padding-left: 60px"><a href="https://go.microsoft.com/fwlink/p/?LinkId=619264">- Download Agents for Microsoft Visual Studio 2013 Update 5</a></p>
<p style="padding-left: 30px"> <strong>Cloud-Based Load testing.</strong> No additional software installation needed.</p>
&nbsp;
<h2>2. Infrastructure/Hardware requirements</h2>
<h4>Visual Studio (IDE) System Requirements</h4>
Visual Studio is used to record webtests, kick off Load Tests and visualize results. It is not recommended to install it on the Controller machine or Test Agents. The system requirements for the machine to host either Visual Studio Enterprise 2015 or Visual Studio Ultimate 2013 are:
<ul>
	<li>Windows 7 SP1 or above, or</li>
	<li>Windows Server 2008 R2 SP1 or above.</li>
	<li>A minimum of 1.6GHz, 1.0 GB of RAM (1.5 if working on a VM).</li>
	<li>10 GB of available HD space (20 GB for VS 2013).</li>
	<li>Check details here:</li>
	<li><a href="https://www.visualstudio.com/en-us/downloads/visual-studio-2015-system-requirements-vs.aspx#2">Visual Studio Enterprise 2015 with Update 1</a></li>
	<li><a href="https://www.visualstudio.com/en-us/downloads/visual-studio-2015-system-requirements-vs.aspx#31">Visual Studio Ultimate 2013 with Update 5</a></li>
</ul>
<h4>Controller and Agents Hardware Requirements</h4>
<p style="padding-left: 30px"><strong>On premises</strong>. If you are planning a load test project in a on premises environment, you will need a controller and at least 1 test agent, to set this up you will need the following:</p>

<ul>
	<li>OS/Framework requirements
<ul>
	<li><span style="text-decoration: underline">Controller</span>: Windows 7 SP1 / 8 / 8.1 or Windows Server 2008 R2 SP1 / 2012 / 2012 R2</li>
	<li><span style="text-decoration: underline">Test Agents</span>: Windows XP SP3 / 7 SP1 / 8 / 8.1 or Windows Server 2008 R2 SP1 / 2012 / 2012 R2.</li>
	<li><span style="text-decoration: underline">Both</span>: .NET Framework 4.5</li>
	<li>More information here: <a href="https://msdn.microsoft.com/en-us/library/dd648127.aspx#Anchor_2">System requirements for Controller and Agents</a></li>
</ul>
</li>
</ul>
<p style="padding-left: 60px">You can also execute local test runs (without controller or test agents) directly from your Visual Studio host, this is done normally for debugging purposes since you are limited by resources.</p>

<ul>
	<li>Hardware sizing</li>
</ul>
<p style="padding-left: 60px">The table below shows the recommended hardware requirements. You can use this table to plan how many test agents and what size of controller suit your load testing needs:</p>

<table style="height: 394px" width="1042">
<tbody>
<tr>
<td width="201"><strong>Configuration </strong></td>
<td width="91"><strong>Component </strong></td>
<td width="139"><strong>CPU </strong></td>
<td width="116"><strong>HD </strong></td>
<td width="76"><strong>Memory </strong></td>
</tr>
<tr>
<td width="201">&lt; 500 virtual users</td>
<td width="91">Test agent</td>
<td width="139">2.6 GHz</td>
<td width="116">10 GB</td>
<td width="76">2 GB</td>
</tr>
<tr>
<td width="201">&lt; 1000 virtual users</td>
<td width="91">Test agent</td>
<td width="139">Dual processor 2.6 GHz</td>
<td width="116">10 GB</td>
<td width="76">2 GB</td>
</tr>
<tr>
<td width="201">N x 1000 virtual users</td>
<td width="91">Test agent</td>
<td width="139">Scale out to N agents each with Dual 2.6 Ghz</td>
<td width="116">10 GB</td>
<td width="76">2 GB</td>
</tr>
<tr>
<td width="201">&lt; 30 computers in the test environment. This includes agents and servers under test.</td>
<td width="91">Test Controller</td>
<td width="139">2.6 GHz</td>
<td width="116">Read load test repository section</td>
<td width="76"></td>
</tr>
<tr>
<td width="201">N x 30 computers in the test environment. This includes agents and servers under test.</td>
<td width="91">Test Controller</td>
<td width="139">N 2.6 GHz processors</td>
<td width="116">Read load test repository section</td>
<td width="76"></td>
</tr>
</tbody>
</table>
&nbsp;
<ul>
	<li>Load Test Repository</li>
</ul>
<p style="padding-left: 60px">Load tests results may be stored in the Load Test Results Repository, which is a SQL database. The Results Repository database is created by setup for controllers (or created automatically on the first local run of a load test), a the database will be created automatically if the load test schema is not present.</p>
<p style="padding-left: 60px"><span style="text-decoration: underline">SQL Server 2012 Express LocalDB</span>, which is installed with Visual Studio is the default database server for load tests. If <span style="text-decoration: underline">SQL Server Express</span> is detected with an existing load test database, Visual Studio Enterprise will try to connect to it and use it.</p>
<p style="padding-left: 60px"><span style="text-decoration: underline">However,</span> for heavier database needs you should consider upgrading to a full SQL Server to provide further scaling potential. Also, SQL Express is limited to using a maximum of 4 GB of disk space. If you will run many load tests over a long period of time, you should consider configuring the load test results store to use an instance of the full SQL Server product if available. More on <a href="https://msdn.microsoft.com/en-us/library/ms318550(v=vs.140).aspx#Anchor_0">Load Test results repository</a>.</p>
<p style="padding-left: 60px">Note: A single 1 hour load test can take from 100MB to 500MB depending on the number of webtests, performance counters, VMs you are monitoring, etc. Plan storage needs accordingly and take in consideration that this information is temporarily stored in the Test Agents, collected in the Controllers RAM memory before finally being placed in the SQL Repository. Plan RAM Memory needs accordingly.</p>

<ul>
	<li>Alternative<strong>:</strong> Testing using VSO or TFS instead of Controller</li>
</ul>
<p style="padding-left: 60px">For test scenarios (still on premises) using Visual Studio Online (VSO) or Team Foundation Server (TFS) 2015, you won't need a test controller because Agents for Microsoft Visual Studio 2015 handle orchestration by communicating with VSO or TFS 2015. For example, you're running automated tests with your build and release workflows in VSO or TFS 2015.</p>

<h4><strong>Cloud-Based Load testing</strong></h4>
<p style="padding-left: 30px">You can use cloud-based load testing to avoid having to use your own resources and machines. In this case you don't need a Controller or Test Agents. The cloud-service provides virtual machines in the cloud that generate the load needed to test your target application/website.</p>
<p style="padding-left: 30px">All you need is a Visual Studio Online (VSO) account. Check 'Getting started with Load Tests' further down in this document.</p>
&nbsp;
<h2>3. Getting started with Webtests</h2>
<h4>Basic components</h4>
<p style="padding-left: 30px">At the most basic level you will need to do the following steps to get started:</p>

<ul>
	<li>Create a web performance and load test project</li>
	<li>Record a web performance test.</li>
	<li>Create a load test.</li>
	<li>Run and analyze your load test</li>
</ul>
<p style="padding-left: 30px"> Follow <a href="https://msdn.microsoft.com/en-us/library/dn250793.aspx">this article</a> to learn how to create the most basic components.</p>

<h4>Validation</h4>
Validation rules help verify that a Web application is working correctly by validating the existence of text, tags, or attributes on the page returned by a Web request. Validation rules can also verify the time that it takes a request to finish, and the existence of form fields and their values.

Check <a href="https://msdn.microsoft.com/library/bb385904(v=vs.110).aspx#UsingValidationExtractionRulesValidationRules">this article</a> to find out how to add predefined Validation rules to your webtest. You can also create your own Validation rules, check Customization section further down on this page.
<h4>Parametrization</h4>
<p style="padding-left: 30px">o    <strong>Constant parameters. </strong>You can create a Context Parameter for any value in a request of a WebTest. The constant parameters are displayed at the bottom of your webtest. A simple case where you would want to do this is for host or website URLs. Read <a href="https://msdn.microsoft.com/en-us/library/ms184806(v=vs.110).aspx">this article</a> for more information.</p>
<p style="padding-left: 30px">o    <strong>Dynamic parameters.</strong> Web sites and applications use dynamic values, this is a value that is generated every time that a user runs the application. A dynamic parameter can cause your Web performance test playback to fail because it has a different value every the test is run. Therefore, you cannot play back recorded values. (E.g. a session ID). To solve this situation you have a couple of options (follow link to articles):</p>
<p style="padding-left: 60px"><a href="https://msdn.microsoft.com/en-us/library/ff356199(v=vs.110).aspx">- Auto-detect dynamic values and promote them to WebTest parameters</a>. Use VS auto-detect feature to identify and parameterize dynamic values (it may not catch all values).</p>
<p style="padding-left: 60px"><a href="https://msdn.microsoft.com/en-us/library/ee317494(v=vs.110).aspx">- Add an Extraction Rule</a>. Find dynamic values by using 'quick find' on recorded results then add an extraction rule:</p>

<ul>
<ul>
<ul>
	<li>Extraction rules extract data from the responses to Web requests and store the results in the test context as name/value pairs. Extraction rules are predefined in Visual Studio (you can also create your own, check Customization section), you can use them to extract form fields, text, attributes, headers, regular expressions, and hidden fields, Check full <a href="https://msdn.microsoft.com/library/bb385904(v=vs.110).aspx#Anchor_0">article here</a>.</li>
</ul>
</ul>
</ul>
<h4>Data Binding</h4>
<p style="padding-left: 30px"> You can bind parameters (e.g. form post parameters) on the requests of your WebTest to data sources to provide different values to the same test. This makes your load test more solid and realistic. You have several options for the data source type:</p>
<p style="padding-left: 60px">- SQL database (several versions permitted, check FAQ)</p>
<p style="padding-left: 60px">- CSV text files</p>
<p style="padding-left: 60px">- XML files (or SOAP XMLs)</p>
<p style="padding-left: 30px"> Check <a href="https://msdn.microsoft.com/en-us/library/ms243142.aspx">this article</a> for a step by step guide.</p>
&nbsp;
<h2>4. Getting started with Load Tests</h2>
<h4>Load Test setup</h4>
<p style="padding-left: 30px">Load Test can be created in a Load Test projects. If you followed the article at the start of Section 3 of this page you must already have a simple Load test. Some of the Load test settings and scenarios can be setup on the initial Wizard or directly on the load test afterwards. Below are descriptions for the main sections:</p>

<h5>Scenarios</h5>
<p style="padding-left: 30px">Load tests contain scenarios, which contain Web performance tests. Scenarios are important because they give you flexibility in configuring test characteristics that allow for simulation of complex, realistic workloads. You can have more than one scenario per load test.</p>
<p style="padding-left: 30px"> Use the Load pattern, test mix model and test mix to specify what webtests to use, the manner in which the load will be applied to your application and pacing.</p>
<p style="padding-left: 30px"> You can also use Browser mix, Network mix to make your workload more realistic. Check MSDN article on <a href="https://msdn.microsoft.com/en-us/library/dd997834.aspx">editing Load tests scenarios</a>.</p>

<h5>Counter Sets, Counters and Mappings</h5>
<p style="padding-left: 30px">Counter sets that are useful when you analyze performance counter data. The counter sets are organized by technology such as Application, .NET Application, IIS, or SQL. You can create counter sets during the initial New Load Test Wizard or later on the load test file itself.</p>
<p style="padding-left: 30px">There is a set of predefined counter sets or you can create your own. You can also add counters to the default Counter Sets or to your own. The counters are added from Perfmon.</p>
<p style="padding-left: 30px"> On the Run settings section of a load test you can specify Counter Set mappings where you can add computers (by DNS or IP) and map them to Counter sets. Visual studio will collect data for every counter on a set for each computer where it is mapped to.</p>
<p style="padding-left: 30px"> To learn more about Counter Sets, thresholds, sampling and other tasks, check <a href="https://msdn.microsoft.com/en-us/library/ms404695.aspx">this article on MSDN</a>.</p>

<h5>Run Settings</h5>
<p style="padding-left: 30px">Run settings are properties that organize the manner in which a load test runs. You can have more than one run setting in a load test but only one can be active at a time while the other settings provide a quick way to select an alternative settings.</p>
<p style="padding-left: 30px">Settings are used to specify things like test duration, Logging, SQL server collection, warm up duration, sampling rate or validation setting between others. You can also add Counter Set Mappings to map computers to Counter Sets.</p>
<p style="padding-left: 30px">Check <a href="https://msdn.microsoft.com/en-us/library/dd997552.aspx">this article</a> for full description of tasks available.</p>

<h4>Running Load Tests On Premises</h4>
<h5>Test Settings file</h5>
<p style="padding-left: 30px">Make sure your Load test is configure to run On premises by checking the General section of your active .testsetting file on your Solution. Test Settings are not the same as Run Settings.</p>
<p style="padding-left: 30px"> Other items to configure on this window are Roles and Timeouts. On the Roles section, test execution method should be set to 'Remote execution' if you want to use your Controller and Test Agents. Check this couple of article to learn more about Test settings: <a href="https://msdn.microsoft.com/en-us/library/dd695837.aspx">Managing Test Controllers and Test Agents with Visual Studio</a>, <a href="https://msdn.microsoft.com/en-us/library/ee256991.aspx#Anchor_2">Edit Test Settings</a>.</p>

<h5>Controller-Agents connectivity</h5>
<p style="padding-left: 30px">Also make sure the Controller can communicate with the Test Agents by checking the Load Test &gt; Manage Test Controllers. That dialog should show if the controller has any Test Agents connected to it. More information here: <a href="https://msdn.microsoft.com/en-us/library/hh546459.aspx#Anchor_5">Manage Test Controllers.</a></p>

<h5>Running the Load Test</h5>
<p style="padding-left: 30px">From that point forward you should be ready to run a Load Test. During or after run time you have access to Graphs and Tables with throughput, response times information, performance counters for the computers you configured and details on vusers activity. Check this tutorial to learn more: <a href="https://msdn.microsoft.com/library/dn250793(v=vs.120).aspx#Anchor_3">Run and analyze your load test</a>.</p>

<h4>Running Load Tests using the Cloud Service</h4>
<p style="padding-left: 30px">There are a couple of options for running a Load test with the Cloud Service:</p>

<ul>
	<li>You can run a Load test from Visual Studio (Enterprise 2015 or Ultimate 2013) and Visual Studio Team Services.
<ul>
	<li>As mentioned above you will need a VS Team Services account.</li>
	<li>Your solution needs to be connect to TFS.</li>
	<li>In your solution; if you open your active .testsettings file, on the General section select 'Run tests using Visual Studio Online':</li>
	<li><a href="https://msdnshared.blob.core.windows.net/media/2016/04/VS_1.png"><img class="alignnone size-full wp-image-65" src="https://msdnshared.blob.core.windows.net/media/2016/04/VS_1.png" alt="VS_1" width="533" height="369" /></a></li>
	<li>From there you can specify the Location you want your load to come from on the Load Test file and run the Load test. Check the <a href="https://www.visualstudio.com/get-started/test/load-test-your-app-vs">full tutorial here</a>, specifically the 'Run and analyze your load test' section.</li>
</ul>
</li>
</ul>
<ul>
	<li>Your second alternative is to run a basic (and much more limited) load test directly in Visual Studio Team Services. The up side is that you don't need a load test project (or Visual Studio). You do need a Visual Studio Enterprise monthly or annual subscription or a MSDN subscription.
<ul>
	<li>To do this you need to go to the Load Test Hub on your Visual Studio Team Services account page.</li>
	<li>Setup is simple, just specify URL, Load location and some simple Test settings. Check the <a href="https://www.visualstudio.com/get-started/test/load-test-your-app-vs#LoadTestHub">com article here.</a></li>
</ul>
</li>
</ul>
&nbsp;
<h2>5. Customization</h2>
Visual Studio offers extendibility options to increase the built-in functionality. Follow the articles below to learn more about the different options:

- <a href="https://msdn.microsoft.com/en-us/library/ms182556(v=vs.140).aspx">Custom Validation Rules</a>. You can create your own validation rules. To do this, you derive your own rule class from a validation rule class. Validation rules derive from the ValidationRule base class.

- <a href="https://msdn.microsoft.com/en-us/library/ms243179(v=vs.140).aspx">Custom Extraction Rules</a>. You can create your own extraction rules. To do this, you derive your own rules from an extraction rule class. Extraction rules derive from the ExtractionRule base class.

- <a href="https://msdn.microsoft.com/en-us/library/ee923683.aspx">Custom Plug-in's.</a> You can create custom plug-in to write code and attach it to a load test or a Web performance test. You can use the load test API and the Web Performance test API to create custom plug-ins for tests to expand to the built-in functionality.
<ul>
	<li><strong>Create a custom plug-in for your Web Performance test</strong>: You can use Web performance test API to create a custom plug-in to add more testing functionality to your Web performance test, including at the request level. You can also create a Web Service test.
<ul>
	<li><a href="https://msdn.microsoft.com/en-us/library/ms182558.aspx">How to: Use the Web Performance Test API</a></li>
	<li><a href="https://msdn.microsoft.com/en-us/library/ms243191.aspx">How to: Create a Web Performance Test Plug-In</a></li>
	<li><a href="https://msdn.microsoft.com/en-us/library/bb514192.aspx">How to: Create a Request-Level Plug-In</a></li>
	<li><a href="https://msdn.microsoft.com/en-us/library/ms182557.aspx">How to: Create a Web Service Test</a></li>
	<li><a href="https://msdn.microsoft.com/en-us/library/ff400224.aspx">How to: Create a Recorder Plug-In</a></li>
</ul>
</li>
</ul>
<ul>
	<li><strong>Create a custom plug-in for your load test:</strong> You can use load test API to create a custom plug-in to add more testing functionality to your load test.
<ul>
	<li><a href="https://msdn.microsoft.com/en-us/library/ms182605.aspx">How to: Use the Load Test API</a></li>
	<li><a href="https://msdn.microsoft.com/en-us/library/ms243153.aspx">How to: Create a Load Test Plug-In</a></li>
</ul>
</li>
</ul>
<h2>FAQ</h2>
<h4>How many vusers can I run per agent?</h4>
As mentioned above the recommendation is up to 500 for a 2.6 GHz processor and up to 1000 for a Dual 2.6 GHz processor. This can change depending on the length of the webtests, the payloads of the application responses and the use of custom plug-ins.
<h4>What version of SQL do I need?</h4>
SQL Express or SQL Express 2012 Localdb for local test runs and debugging. Full SQL for heavier needs such as an Enterprise level application performance test project, for example the standard version of SQL Server 2014, 2012, or 2008 R2.
<h4>Can load tests use other test types in their test mix besides web performance tests?</h4>
Yes, you can include unit tests and coded UI tests.
<h4>Can virtual users simulate pausing between test steps?</h4>
Yes, you can specify think times to simulate the time spent by a user on a web page.
<h4>Can I mix versions of TFS, Microsoft Test Manager, the test controller, and test agent?</h4>
Yes, here are the compatible and supported combinations:
<table style="height: 200px" width="923">
<tbody>
<tr>
<td width="247"><strong>TFS </strong></td>
<td width="263"><strong>Microsoft Test Manager, with Lab Center </strong></td>
<td width="83"><strong>Controller </strong></td>
<td width="67"><strong>Agent </strong></td>
</tr>
<tr>
<td width="247">2015: upgrade from 2013</td>
<td width="263">2013</td>
<td width="83">2013</td>
<td width="67">2013</td>
</tr>
<tr>
<td width="247">2015: new install</td>
<td width="263">2013</td>
<td width="83">2013</td>
<td width="67">2013</td>
</tr>
<tr>
<td width="247">2015: upgrade from 2015 or new install</td>
<td width="263">2015</td>
<td width="83">2013</td>
<td width="67">2013</td>
</tr>
<tr>
<td width="247">2013</td>
<td width="263">2015</td>
<td width="83">2013</td>
<td width="67">2013</td>
</tr>
</tbody>
</table>
<p style="padding-left: 30px"> <a href="https://msdn.microsoft.com/en-us/library/dd648127.aspx#Anchor_2">https://msdn.microsoft.com/en-us/library/dd648127.aspx#Anchor_2</a></p>

<h4>What firewall permissions do I need?</h4>
The default port used by the test controller is 6901 and the test agent's default port is 6910. The client (Visual Studio machine) uses a random port by default which is used to receive the test results from the test controller. For all incoming connections, the test controller authenticates the calling party and verifies that it belongs to specific security group. This is true regardless of the test rig configuration you are using: on premises or cloud based testing:

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/VS_TestAgents_Ports_Requirements.png"><img class="alignnone wp-image-55 size-full" src="https://msdnshared.blob.core.windows.net/media/2016/04/VS_TestAgents_Ports_Requirements.png" alt="VS_TestAgents_Ports_Requirements" width="675" height="335" /></a>

&nbsp;

You should create exceptions for the mentioned ports on the firewall, you can also change the port. Check this msdn article for more information: <a href="https://msdn.microsoft.com/en-us/library/ff652627.aspx">Configuring Ports for Test Controllers and Test Agents</a>
<h4>What databases can I use as a data source?</h4>
You can use the following:
<ul>
	<li>Microsoft SQL Azure.</li>
	<li>Any version of Microsoft SQL Server 2005 or later.</li>
	<li>Microsoft SQL Server database file (including SQL Express).</li>
	<li>Microsoft ODBC.</li>
	<li>Microsoft Access file using the .NET Framework provider for OLE DB.</li>
	<li>Oracle 7.3, 8i, 9i, or 10g.</li>
</ul>
<h4>What is a good place to learn more?</h4>
Aside from MSDN you can go to Channel 9 videos for a more visual learning experience:
<p style="padding-left: 30px"><a href="https://blogs.msdn.microsoft.com/visualstudioalm/2015/12/10/visual-studio-2015-test-tools-getting-started-content/">https://blogs.msdn.microsoft.com/visualstudioalm/2015/12/10/visual-studio-2015-test-tools-getting-started-content/</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>