次の方法で共有


How to: Add a threshold rule using the load test editor

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

Threshold rules in load tests compare a performance counter value with either a constant value or another performance counter value.

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.

To add a threshold rule

  1. Open a load test.

  2. In the Load Test Editor, expand the Counter Sets node.

  3. Expand one of the Counter Categories in one of the Counter Sets. For example, you can select LoadTest:Scenario. Expand the node.

  4. Right-click one of the counters, for example, User Load, under LoadTest:Scenario. Select Add Threshold Rule.

    The Add Threshold Rule dialog box is displayed.

  5. You can choose from two types of rules: Compare Constant and Compare Counter. Select the appropriate type and set the values.

    Note

    Set the Alert If Over property to True to indicate that exceeding a threshold is a problem, or to False to indicate that falling below a threshold is a problem.

See also