|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Assembly: Microsoft.VisualStudio.QualityTools.LoadTestFramework (in microsoft.visualstudio.qualitytools.loadtestframework.dll)
This can be implemented by a user-written class to plug user-written code into the load test run time engine on the agent. This plug-in is specified in the load test editor.
You can create a load test plug-in to run code at different times while a load test is running, such as after a threshold is violated, before a load test starts and after a load test finishes, before a test iteration starts and after it finishes, when a load test aborts, or when the load in the test has changed. The events that the implementation of ILoadTestPlugin may handle are:, , , , , , , , and .
An implementation of a load test plug-in can be used to extend or modify the behavior of a load test as it runs. The following list contains some possible uses of a load test plug-in:
Start an external process such as a monitoring tool just before the load test starts, and stop it when the load test completes.
Provide programmatic control over the user load used as the load test runs; overriding the user load specified in the load test editor.
Provide programmatic control over the selection of an individual test to run within the load test; overriding the default test selection algorithm.
Abort the load test if the value of a performance counter causes the failure of a threshold rule defined in the load test.
Maintain a shared variable across all test iterations in a load test. To do this, the load test plug-in implements a variable as a static property that is accessed by the tests under load. The variable is initialized in themethod of the load test plug-in. An event handler is added for the LoadTestFinished event that can be used to access the final value for reporting purposes.