Load Simulation

Select and compose load models to represent your target traffic pattern.

Time-Based Simulations

Inject(rate, interval, during), InjectRandom(minRate, maxRate, interval, during), RampingInject(rate, interval, during), KeepConstant(copies, during), RampingConstant(copies, during), and Pause(during) are duration-driven models.

Iteration-Based Simulations

IterationsForInject(rate, interval, iterations) and IterationsForConstant(copies, iterations) run for a fixed iteration count instead of a fixed duration.

Parameter Fields

rate/minRate/maxRate define request emission intensity, copies defines concurrent virtual users, interval controls pacing, during controls time window, and iterations controls total execution cycles. Helper APIs also expose IsInject/IsInjectRandom/IsIterationsForInject/IsIterationsForConstant and related flags plus string formatting helpers on returned simulation definitions.

Composition

Attach multiple simulations in sequence using WithLoadSimulations to model warm-up, ramp-up, steady-state, and cooldown phases in one scenario definition.

Feature Usage Samples

How to use snippets for Load Simulation.

Switch between C#, Java, Python, TypeScript, and JavaScript to see the native SDK shape for this sample.

Licensing note: every runnable sample requires a valid runner key via WithRunnerKey("...") or config key LoadStrike:RunnerKey.

Load Simulations

scenario = scenario.WithLoadSimulations(
    LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20)),
    LoadStrikeSimulation.RampingInject(20, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20)),
    LoadStrikeSimulation.KeepConstant(5, TimeSpan.FromSeconds(20)),
    LoadStrikeSimulation.Pause(TimeSpan.FromSeconds(3))
);

Supported Simulations

Inject

Emit requests at a fixed rate per interval for a fixed duration.

InjectRandom

Vary the request rate between a minimum and maximum value each interval to simulate uneven live traffic.

RampingInject

Increase the request rate progressively over time instead of keeping it flat from the start.

KeepConstant

Run a fixed number of concurrent copies for the requested duration.

RampingConstant

Increase the number of concurrent copies gradually until the target steady-state concurrency is reached.

Pause

Insert a quiet gap between simulation phases without ending the scenario definition.

IterationsForInject

Run an inject-style rate pattern for a fixed number of iterations instead of a time window.

IterationsForConstant

Run a fixed concurrency pattern for a fixed number of iterations instead of a duration.

Choose rate-based simulations when you care about requests per interval, and copy-based simulations when you care about concurrent workload copies.