6.28HttpStressTestHarnessBuilder Builder

Created on Aug 17, 2026~2 min read

The HttpStressTestHarnessBuilder builder provides the various settings the framework offers specifically for stress testing and simulation testing. The HttpStressTestHarnessBuilder constructor is private, so it cannot be instantiated directly with the new keyword; however, the framework provides several static overloads of HttpRequestBuilder.StressTestHarness to create an instance of HttpStressTestHarnessBuilder.

cs
HttpRequestBuilder.StressTestHarness(httpMethod, requestUri, numberOfRequests, configure);HttpRequestBuilder.StressTestHarness(requestUri, numberOfRequests, configure); // Defaults to a GET request

In addition, HttpStressTestHarnessBuilder provides the following configuration capabilities:

cs
// Defaults to a GET request, with a default of 100 concurrent requestsHttpRequestBuilder.StressTestHarness("https://furion.net/")    // Sets the number of concurrent requests; default is 100    .SetNumberOfRequests(500)    // Sets the maximum degree of parallelism; default is 100    .SetMaxDegreeOfParallelism(500)    // Sets the number of stress-test rounds; default is 1    .SetNumberOfRounds(5)    // Disables the HTTP cache    .DisableCache()    // Sets the HttpRequestBuilder instance    .With(builder => {});

After successfully building an HttpStressTestHarnessBuilder instance through the HttpRequestBuilder.StressTestHarness method, you can use the Send method or the asynchronous SendAsync method to perform the send operation.

cs
httpRemoteService.Send(httpStressTestHarnessBuilder, HttpCompletionOption.ResponseContentRead, cancellationToken);await httpRemoteService.SendAsync(httpStressTestHarnessBuilder, HttpCompletionOption.ResponseContentRead, cancellationToken);