Worker Plugins
Extend runtime behavior with custom worker plugins and table outputs.
Built-In Plugin
Failed and timed out rows are automatically captured by the built-in plugin. Custom worker plugins receive typed LoadStrikeBaseContext, LoadStrikeSessionStartInfo, and LoadStrikeNodeStats service-layer contracts. LoadStrikeBaseContext exposes node metadata through NodeInfo and GetNodeInfo(), Python exposes NodeInfo accessors, and TypeScript/JavaScript custom plugins use PascalCase members such as PluginName, Init, Start, GetData, Stop, and Dispose in the public docs surface.
Report Configuration and Output Samples
Report-focused snippets for Worker Plugins.
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.
HTML reports include an icon-only Light/Dark theme toggle fixed at the top-right. Default report theme is Light.
Worker Plugin
public sealed class SimplePlugin : ILoadStrikeWorkerPlugin
{
public string PluginName => "simple";
public Task Init(LoadStrikeBaseContext context, IConfiguration infraConfig) => Task.CompletedTask;
public Task Start(LoadStrikeSessionStartInfo sessionInfo) => Task.CompletedTask;
public Task Stop() => Task.CompletedTask;
public Task<LoadStrikePluginData> GetData(LoadStrikeNodeStats stats)
{
var table = LoadStrikePluginDataTable.Create("summary");
table.Rows.Add(new Dictionary<string, object> { ["name"] = "requests", ["value"] = stats.AllRequestCount });
var data = LoadStrikePluginData.Create(PluginName);
data.Hints.Add("Adds a custom report table.");
data.Tables.Add(table);
return Task.FromResult(data);
}
}
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeBaseContext;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeNodeStats;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikePluginData;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikePluginDataTable;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeSessionStartInfo;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeWorkerPlugin;
final class SimplePlugin implements LoadStrikeWorkerPlugin {
@Override
public String pluginName() {
return "simple";
}
@Override
public void init(LoadStrikeBaseContext context, Map<String, Object> infraConfig) {}
@Override
public void start(LoadStrikeSessionStartInfo sessionInfo) {}
@Override
public void stop() {}
@Override
public LoadStrikePluginData getData(LoadStrikeNodeStats stats) {
var table = LoadStrikePluginDataTable.create("summary");
table.headers = List.of("name", "value");
table.rows = new ArrayList<>();
table.rows.add(new LinkedHashMap<>(Map.of("name", "requests", "value", stats.AllRequestCount)));
var data = LoadStrikePluginData.create(pluginName());
data.hints = new ArrayList<>(List.of("Adds a custom report table."));
data.tables = new ArrayList<>(List.of(table));
return data;
}
}
from loadstrike_sdk import LoadStrikePluginData, LoadStrikePluginDataTable
class SimplePlugin:
plugin_name = "simple"
PluginName = "simple"
def init(self, context, infra_config):
return None
def start(self, session):
return None
def stop(self):
return None
def get_data(self, result):
table = LoadStrikePluginDataTable.create("summary")
table.headers.extend(["name", "value"])
table.add_row({"name": "requests", "value": result.all_request_count})
data = LoadStrikePluginData.create(self.plugin_name)
data.hints.append("Adds a custom report table.")
data.add_table(table)
return data
import {
LoadStrikePluginData,
LoadStrikePluginDataTable,
LoadStrikeRunner
} from "@loadstrike/loadstrike-sdk";
const plugin = {
pluginName: "simple",
getData(result) {
const table = LoadStrikePluginDataTable.create("summary");
table.headers.push("name", "value");
table.rows.push({ name: "requests", value: result.allRequestCount });
const data = LoadStrikePluginData.create("simple");
data.hints.push("Adds a custom report table.");
data.tables.push(table);
return data;
}
};
await LoadStrikeRunner.registerScenarios(scenario).withWorkerPlugins(plugin).withRunnerKey("rkl_your_local_runner_key").run();
const {
LoadStrikePluginData,
LoadStrikePluginDataTable,
LoadStrikeRunner
} = require("@loadstrike/loadstrike-sdk");
const plugin = {
pluginName: "simple",
getData(result) {
const table = LoadStrikePluginDataTable.create("summary");
table.headers.push("name", "value");
table.rows.push({ name: "requests", value: result.allRequestCount });
const data = LoadStrikePluginData.create("simple");
data.hints.push("Adds a custom report table.");
data.tables.push(table);
return data;
}
};
await LoadStrikeRunner.registerScenarios(scenario).withWorkerPlugins(plugin).withRunnerKey("rkl_your_local_runner_key").run();
Registration
Register one or more custom worker plugins so they participate in the run lifecycle and final report generation.
Plugins receive typed base context, session start info, final node stats, and a stop callback in a fixed lifecycle order across all supported SDKs.
Build custom hints and tables with LoadStrikePluginData.Create(...) and LoadStrikePluginDataTable.Create(...).