Runner Builder

Compose runs with LoadStrikeRunner.Create, AddScenario(s), BuildContext, and argument-based Run overloads.

Builder Pattern

Use LoadStrikeRunner.Create() to start fluent composition, then AddScenario/AddScenarios and Configure(...) to apply context options before Run(). Java, Python, and TypeScript/JavaScript all mutate the same runner/context instance through fluent builders and static helper wrappers. TypeScript/JavaScript also support Configure(ctx => ...) builder flow in addition to direct options objects.

BuildContext

Use BuildContext() when you want a reusable configured LoadStrikeContext and run it multiple times with different CLI overrides. Java and Python BuildContext() retain the registered scenario set so LoadStrikeContext.Run() / RunDetailed() and LoadStrikeRunner.Run(context) execute directly. Java `configure(ctx -> ...)` and fluent `with*` builder calls compose before scenarios are added; Python also preserves those scenarios when the context is reapplied through LoadStrikeRunner.Create().ConfigureContext(context).Run() or Configure(context).Run(). TypeScript/JavaScript reusable contexts follow the same model.

Run Overloads

Use Run() for configured execution and Run(string[] args) or Run(params string[] args) for command-line style overrides. Java and Python service-layer runs project LoadStrikeNodeStats and fail fast when a runner has no registered scenarios or a target-selection filter resolves to none. Reusable `LoadStrikeContext` instances keep CLI-applied overrides after Run(args), while runner-level Run(args) calls remain one-shot per execution. In Java, use RunDetailed() / LoadStrikeContext.RunDetailed(...) when you need raw detailed artifacts such as reportFiles, sinkErrors, disabledSinks, or correlation rows. TypeScript/JavaScript also support LoadStrikeContext.Run() / RunDetailed() and direct array or variadic Run override flows (`context.Run(["--Key=value"])`, `context.Run("--Key=value", ...)`) with case-insensitive keys, malformed-token ignoring, numeric NodeType enum tokens, execution-time `--config` / `--infraconfig` file loading, and additive PascalCase result aliases such as AllRequestCount, NodeInfo, Metrics, PluginsData, and ScenarioStats.

Feature Usage Samples

How to use snippets for Runner Builder.

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.

Runner Builder

var runner = LoadStrikeRunner.Create()
    .AddScenario(scenario)
    .Configure(ctx => ctx.WithReportFolder("./reports").WithRunnerKey("rkl_your_local_runner_key"));

var context = runner.BuildContext();
var stats = context.Run("--testsuite=builder-smoke");

Builder APIs

Create

Start a new fluent runner builder before any scenarios or runtime options are attached.

AddScenario / AddScenarios

Register one or more scenarios that the builder should carry into the final execution context.

Configure(ctx => ...)

Apply context settings such as reports, runner key, cluster options, sinks, or plugins before execution.

BuildContext

Materialize a reusable LoadStrikeContext that can be executed directly or reused with CLI-style overrides later.

Run / Run(args)

Execute immediately with the current configuration, optionally layering one-shot CLI-style overrides on top.

RunDetailed

Return detailed artifacts such as report files, disabled sinks, sink errors, and raw run metadata when you need the expanded result surface.

Across Java, Python, TypeScript, and JavaScript, the builder keeps registered scenarios in the reusable context, fails fast when the resolved scenario selection is empty, preserves omitted settings during partial configure merges, and exposes native timestamp/result aliases that match each language runtime.