Share via


LoadTestContext Class

Encapsulates information about the context in which the load test is running.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.TestTools.LoadTesting.LoadTestContext

Namespace:  Microsoft.VisualStudio.TestTools.LoadTesting
Assembly:  Microsoft.VisualStudio.QualityTools.LoadTestFramework (in Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public Class LoadTestContext _
    Implements IDictionary(Of String, Object),  _
    ICollection(Of KeyValuePair(Of String, Object)), IEnumerable(Of KeyValuePair(Of String, Object)),  _
    IEnumerable
[SerializableAttribute]
public class LoadTestContext : IDictionary<string, Object>, 
    ICollection<KeyValuePair<string, Object>>, IEnumerable<KeyValuePair<string, Object>>, 
    IEnumerable
[SerializableAttribute]
public ref class LoadTestContext : IDictionary<String^, Object^>, 
    ICollection<KeyValuePair<String^, Object^>>, IEnumerable<KeyValuePair<String^, Object^>>, 
    IEnumerable
[<SerializableAttribute>]
type LoadTestContext =  
    class 
        interface IDictionary<string, Object>
        interface ICollection<KeyValuePair<string, Object>>
        interface IEnumerable<KeyValuePair<string, Object>>
        interface IEnumerable 
    end
public class LoadTestContext implements IDictionary<String, Object>, ICollection<KeyValuePair<String, Object>>, IEnumerable<KeyValuePair<String, Object>>, IEnumerable

The LoadTestContext type exposes the following members.

Properties

  Name Description
Public property AgentCount Gets the total number of agents that are used in the load test run.
Public property AgentId Gets the one-based index for the current agent.
Public property AgentName Gets the name of the current agent.
Public property ControllerName Gets the name of the computer that acts as the controller for the load test run.
Public property Count Gets the number of elements that are contained in the LoadTestContext object.
Public property IsLocalRun Gets a value that indicates whether the test was run locally or remotely.
Public property IsReadOnly Gets a value that indicates whether LoadTestContext is read-only.
Public property Item Gets or sets a LoadTestContext element that has the specified key.
Public property Keys Gets an ICollection that contains the keys of the LoadTestContext elements.
Public property LoadTestRunId Gets the ID that is associated with this load test run. Set accessor is set to internal.
Public property Values Gets the ICollection that contains the values in the LoadTestContext elements.

Top

Methods

  Name Description
Public method Add(KeyValuePair<String, Object>) Adds a KeyValuePair item to the LoadTestContext.
Public method Add(String, Object) Adds an element that has the provided key and value to the LoadTestContext.
Public method Clear Removes all items from the LoadTestContext.
Public method Contains Determines whether the LoadTestContext contains a specific value.
Public method ContainsKey Indicates whether the LoadTestContext contains an element that has the specified key.
Public method CopyTo Copies the elements of the LoadTestContext to an Array, starting at a particular Array index.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetEnumerator Returns an enumerator that iterates through the LoadTestContext.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Remove(KeyValuePair<String, Object>) Removes the first occurrence of a specific object from the LoadTestContext.
Public method Remove(String) Removes the element that has the specified key from the LoadTestContext.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryGetValue Gets the value that is associated with the specified key.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator

Top

Remarks

This is a collection of context items and load test configurations used for storing information that is used by the load test.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.TestTools.LoadTesting Namespace

Other Resources

Working with Load Tests Overview