LoadTestGoalBasedLoadProfile.CounterName Property
Gets or sets the performance counter to monitor.
Namespace: Microsoft.VisualStudio.TestTools.LoadTesting
Assembly: Microsoft.VisualStudio.QualityTools.LoadTestFramework (in Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll)
Syntax
'Declaration
Public Property CounterName As String
'Usage
Dim instance As LoadTestGoalBasedLoadProfile
Dim value As String
value = instance.CounterName
instance.CounterName = value
public string CounterName { get; set; }
public:
property String^ CounterName {
String^ get ();
void set (String^ value);
}
public function get CounterName () : String
public function set CounterName (value : String)
Property Value
Type: System.String
The name of the performance counter to monitor.
Remarks
CategoryName, CounterName, InstanceName, and MachineName are the performance counter identifier properties. These properties combine to identify an instance of a performance counter to collect. Any or all of the performance counter identifier properties for a GoalBasedLoadProfile can be changed when a new GoalBasedLoadProfile is assigned by a plug-in.
However, if the performance counter specified cannot be collected because it does not exist or because of lack of the required permissions, an error is reported and the current load profile settings remain in effect.
Changes to any of the properties of any of the LoadTestLoadProfile classes should all be made before you assign the LoadTestLoadProfile object to the LoadProfile property of the LoadTestScenario. After the LoadTestLoadProfile object has been assigned to the LoadProfile property, it becomes a read-only version. An exception will be thrown if you try to set any of the properties of the LoadProfile object while it is in the read-only state. To get a new writable LoadProfile object, call the Copy() method as shown in example under LoadTestGoalBasedLoadProfile.
Examples
An example counter category to monitor is Requests/Sec.
To monitor the processor time used by SQL Server, set MachineName to the name of the computer that is running SQL Server, set CategoryName to Process, set CounterName to % Processor Time, and set InstanceName to sqlservr.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
LoadTestGoalBasedLoadProfile Class