What Is A Transaction?

A transaction in LoadStrike is the full workflow you care about, not just one request. Read this page first if your workload crosses systems.

Guide

Definition

In LoadStrike, a transaction is the business workflow that matters to the team. It might start at an API edge, continue through Kafka or another transport, and finish only when the downstream work proves the outcome really happened.

Why It Matters

A fast first request does not always mean the system stayed healthy. Transaction testing keeps the full workflow together so you can see whether queues, workers, follow-on services, and browser steps still complete correctly under load.

How LoadStrike Models It

You model the workflow as a scenario, name the important operations as steps, and add source and destination endpoints when the path crosses systems. LoadStrike then correlates those events and reports the whole outcome as one performance story.

Feature Usage Samples

Licensing note: every runnable sample still needs a valid runner key. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey before you run the test.

Transaction Example

using LoadStrike;

var httpClient = new HttpClient
{
    BaseAddress = new Uri("https://api.example.com")
};

var scenario = LoadStrikeScenario.Create("submit-orders", async context =>
{
    var step = await LoadStrikeStep.Run<string>("POST /orders", context, async () =>
    {
        var payload = new
        {
            orderId = $"ord-{context.InvocationNumber}",
            amount = 49.95m
        };

        using var response = await httpClient.PostAsJsonAsync("/orders", payload);

        return response.IsSuccessStatusCode
            ? LoadStrikeResponse.Ok<string>(statusCode: ((int)response.StatusCode).ToString())
            : LoadStrikeResponse.Fail<string>(
                statusCode: ((int)response.StatusCode).ToString(),
                message: "Order submission failed");
    });

    return step.AsReply();
})
.WithLoadSimulations(
    LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20))
);

LoadStrikeRunner.RegisterScenarios(scenario)
    .WithRunnerKey("rkl_your_local_runner_key")
    .Run();

Transaction parts

Business workflow

The scenario name should describe the workflow being validated, not only the endpoint being called.

Critical step

Use a named step for the operation that matters to the transaction so reports stay readable.

Load profile

Attach the concurrency or rate pattern that represents the real workload you want to simulate.

Correlated result

When the workflow crosses systems, attach source and destination definitions so the runtime can measure completion end to end.