C# scenarios
Write scenarios in ordinary C#. Step names are unique inside a scenario, and ScenarioContext carries state between steps. Think time, setup and teardown sit outside the measured steps.
CSharpLoad is a C#-first load and performance testing framework for .NET 10. Scenarios, arrival-rate or virtual-user workloads, thresholds and baselines live with the service. A passed gate exits 0. A failed threshold or regression exits 1.
LoadTest.Create("checkout") .WithLoad(Load.ConstantRate(250, duration)) .WithThresholds(thresholds) .ReportHtml("report.html");
Write scenarios in ordinary C#. Step names are unique inside a scenario, and ScenarioContext carries state between steps. Think time, setup and teardown sit outside the measured steps.
Exercise HTTP, gRPC unary calls, WebSockets, SignalR, RabbitMQ, Kafka, ADO.NET SQL and Redis through the matching packages.
Enforce p95, p99, error-rate and throughput thresholds in CI. A failed threshold fails the performance gate.
Write JSON, Markdown, HTML and JUnit reports. GitHub Actions annotations mark failed thresholds. With no reporter configured, the run writes a console report.
Compare the current run with a baseline of p95, p99, throughput and error rate. The baseline file is saved only when the complete gate passes.
Coordinate agents for a larger campaign. The coordinator probes agents, partitions the load, starts them together and merges successful nodes. Studio ingests the merged JSON report.
Each scenario is checked against p95, p99, error rate and throughput. The process exit code is the gate: 0 when it passes, 1 when a threshold or regression fails. JSON, JUnit and GitHub Actions annotations stay with the job, including when the gate fails.
Separate packages cover HTTP, gRPC unary calls, WebSockets, SignalR, RabbitMQ, Kafka, ADO.NET and Redis. Open workloads use a constant or ramped arrival rate. Closed workloads hold or ramp a virtual-user count. WithMaxConcurrency bounds local concurrency.
A baseline stores p95, p99, requests per second and error rate per scenario, plus branch, commit and source. SaveBaseline writes that file only when the full gate passes. Later runs, and the CSharpLoad CLI, compare against it.
The test process returns 0 when the gate passes and 1 when a threshold or regression check fails. The CLI returns 2 when the input or a file is invalid. Archive the report even when the exit code is 1.
Open models schedule an arrival rate, either constant or ramped. Closed models keep a virtual-user population, either fixed or ramped. WithMaxConcurrency limits local concurrency and should match the requested population on a closed workload.
JSON, Markdown, HTML, JUnit XML and GitHub Actions annotations. JSON is the versioned report CSharpLoad Studio ingests. Schemas 1.0, 1.1 and 1.2 are accepted by Studio.
Yes. CSharpLoad.Distributed supplies the coordinator, and CSharpLoad.Distributed.AspNetCore hosts agents. Distributed tests should publish the merged JSON report. The distributed JSON file keeps the optional per-node detail.