DOCS / CSHARPLOAD / CI/CD PERFORMANCE GATES
CI/CD performance gates
CSharpLoad is designed to return the performance result as the process exit code.
var result = await LoadTest.Create("api-load").AddScenario(scenario).WithLoad(Load.ConstantRate(50, TimeSpan.FromSeconds(30))).WithThresholds(Threshold.P95LessThan(TimeSpan.FromMilliseconds(500)), Threshold.ErrorRateLessThan(0.01)).ReportJson("artifacts/load.json").ReportJUnit("artifacts/load.junit.xml").ReportGitHubActions().RunAsync();
return result.ExitCode;Upload the artifacts even when the test fails so Studio and CI can inspect the report. Keep a known-good baseline from main and compare pull-request runs before merge.