JSON Config
Use JSON config when you want runtime settings outside the source code. This is useful for shared environments, CI, and repeatable test hosts.
Matching docs
Search across docs titles, summaries, groups, and section headings.
Use Up and Down Arrow to move through results, then press Enter to open the active page.
No indexed docs matched that search. Try a broader term or open the docs hub.
What this page helps you do
What this page helps you do
Use JSON config when you want runtime settings outside the source code. This is useful for shared environments, CI, and repeatable test hosts.
Who this is for
Engineers writing or reviewing scenario code in one of the supported SDKs.
Prerequisites
- A scenario or runtime surface you want to wire correctly in code
By the end
The exact SDK surface you need for this part of the runtime.
Use this page when
Use this reference when you already know the workflow and need the exact JSON Config API surface in code.
Visual guide
Guide
LoadConfig
Use LoadConfig(path) for normal runtime settings and LoadInfraConfig(path) for sink or plugin infrastructure settings. TypeScript and JavaScript BuildContext run flows also honor `--config=<path>` and `--infraconfig=<path>` at execution time.
Supported Keys
JSON config can hold test identity, report settings, node and cluster settings, runner key settings, and timeout values. Common examples are TestSuite, TestName, SessionId, ReportFolder, ReportFileName, ReportFormats, and ReportingIntervalMs.
Parsing Rules
Boolean keys use strict true or false parsing only. Config and CLI key lookup is case-insensitive. List-like keys such as ReportFormats, TargetScenarios, AgentTargetScenarios, and CoordinatorTargetScenarios are comma-delimited and de-duplicated using case-sensitive ordinal matching. ReportFormats accepts only txt, html, csv, md, or the markdown alias. NodeType numeric tokens map to 0=SingleNode, 1=Coordinator, 2=Agent.
Override Order
LoadStrike starts with the base context values, merges JSON settings into that context, and then lets CLI arguments override both for one-off execution changes.
SDK reference samples
Use these SDK samples to compare how JSON Config is exposed across the supported languages before you wire it into a full scenario.
If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.
JSON Config
using LoadStrike;
LoadStrikeRunner.RegisterScenarios(scenario).LoadConfig("./appsettings.loadstrike.json").Run();
package main
import loadstrike "loadstrike.com/sdk/go"
func main() {
scenario := loadstrike.CreateScenario("config-demo", func(loadstrike.LoadStrikeScenarioContext) loadstrike.LoadStrikeReply {
return loadstrike.OK()
}).
WithLoadSimulations(loadstrike.LoadStrikeSimulation.IterationsForConstant(1, 1))
loadstrike.RegisterScenarios(scenario).
LoadConfig("./appsettings.loadstrike.json").
Run()
}
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeResponse;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeRunner;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeScenario;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeSimulation;
var scenario = LoadStrikeScenario
.create("submit-orders", ignoredContext -> LoadStrikeResponse.ok("200"))
.withLoadSimulations(LoadStrikeSimulation.inject(10, 1d, 20d));
LoadStrikeRunner
.registerScenarios(scenario)
.LoadConfig("./appsettings.loadstrike.json")
.run();
from loadstrike_sdk import LoadStrikeResponse, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation
scenario = (
LoadStrikeScenario.create("submit-orders", lambda _: LoadStrikeResponse.ok("200"))
.with_load_simulations(LoadStrikeSimulation.inject(10, 1, 20))
)
LoadStrikeRunner.register_scenarios(scenario).load_config("./appsettings.loadstrike.json").run()
import {
LoadStrikeResponse,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation
} from "@loadstrike/loadstrike-sdk";
const scenario = LoadStrikeScenario
.create("submit-orders", async () => LoadStrikeResponse.ok("200"))
.withLoadSimulations(LoadStrikeSimulation.inject(10, 1, 20));
await LoadStrikeRunner
.registerScenarios(scenario)
.LoadConfig("./appsettings.loadstrike.json")
.run();
const {
LoadStrikeResponse,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation
} = require("@loadstrike/loadstrike-sdk");
(async () => {
const scenario = LoadStrikeScenario
.create("submit-orders", async () => LoadStrikeResponse.ok("200"))
.withLoadSimulations(LoadStrikeSimulation.inject(10, 1, 20));
await LoadStrikeRunner
.registerScenarios(scenario)
.LoadConfig("./appsettings.loadstrike.json")
.run();
})();
Supported config keys and how they behave
A typical runtime config file keeps the main run settings under the LoadStrike section and uses the nested LicenseValidation object for licensing timeout settings.
Loads normal runtime configuration such as report output and run identity settings.
Loads sink and plugin infrastructure settings, usually from a different file than the main runtime config.
Optional run identity fields used in reports, sink exports, and final artifact names.
Report output controls. WithoutReports disables local report file generation.
Comma-delimited report format list. Accepted tokens are txt, html, csv, md, and markdown. Generated local report files use LF line endings across SDKs.
Realtime reporting cadence in milliseconds. The value must be positive.
Positive timeout controls for scenario shutdown and coordinator-agent coordination.
Cluster-role settings for local or distributed execution. NodeType accepts SingleNode, Coordinator, Agent, or numeric 0, 1, 2.
Comma-delimited scenario filters used to target work to the right runtime role.
Logging and runtime behavior controls. DisplayConsoleMetrics and EnableLocalDevCluster are strict booleans.
Licensing settings. RunnerKey is required for runnable workloads, and the license validation timeout must be positive when configured.
{
"LoadStrike": {
"TestSuite": "orders-suite",
"TestName": "submit-orders",
"SessionId": "orders-local-smoke",
"ReportFolder": "./reports",
"ReportFileName": "orders-local-smoke",
"ReportFormats": "html,csv,md",
"ReportingIntervalMs": 5000,
"ScenarioCompletionTimeoutMs": 30000,
"ClusterCommandTimeoutMs": 30000,
"TargetScenarios": "submit-orders",
"MinimumLogLevel": "Information",
"DisplayConsoleMetrics": true,
"EnableLocalDevCluster": false,
"RestartIterationMaxAttempts": 1,
"RunnerKey": "rkl_your_local_runner_key",
"LicenseValidation": {
"TimeoutMs": 10000
}
}
}
Configuration key lookup is case-insensitive, boolean parsing is strict, and list values are split on commas with case-sensitive de-duplication.