Traffic Mix

Split one total load profile across weighted scenario lanes when a workload needs a controlled business-path mix such as 60% checkout, 30% search, and 10% account lookup. Available on Business and Enterprise plans.

What this page helps you do

What this page helps you do

Split one total load profile across weighted scenario lanes when a workload needs a controlled business-path mix such as 60% checkout, 30% search, and 10% account lookup. Available on Business and Enterprise plans.

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 Traffic Mix API surface in code.

Visual guide

Scenario lifecycle flow showing create, init, steps, clean, and report output.
Scenario and step APIs feed the same lifecycle from construction through measured work and final report rows.

Guide

What It Does

LoadStrikeTrafficMix lets you define one total load profile and distribute that profile across multiple scenarios using LoadStrikeScenarioShare weights. A 1000 requests-per-second profile with weights 60, 30, and 10 sends roughly 600 requests per second to the first scenario, 300 to the second, and 100 to the third.

Use Scenarios, Not Steps

Use traffic mix lanes when different business paths should receive different shares of the total workload. Keep steps for measuring parts of one scenario. Steps inside a scenario run as part of that scenario flow; they are not independent traffic destinations.

How It Runs

Register the mix with RegisterTrafficMix or add it to a runner with AddTrafficMix. LoadStrike expands the weighted lanes into normal scenarios before execution, so thresholds, reports, customer portal reporting, and reporting sinks continue to use the standard scenario model.

Rounding Rules

Weights are ratios, not percentages that must add to 100. For integer load values, LoadStrike uses deterministic largest-remainder splitting so the lane totals add back up to the original total load.

When To Use It

Use a traffic mix when product or production data says one shared workload should be split by journey, endpoint family, tenant type, region, or customer action. Use separate WithLoadSimulations calls when each scenario already has its own independent load profile.

Plan Gate

Traffic Mix workload distribution is available on Business and above. Runs still validate all other features used by each lane, such as transports, reporting sinks, thresholds, portal reporting, or cluster settings.

SDK reference samples

Use these samples to split one total load profile across separate scenario lanes. The same run still reports normal scenario and step metrics for each lane.

If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.

Traffic Mix

using LoadStrike;

var checkoutScenario = LoadStrikeScenario.Create("checkout", _ => Task.FromResult(LoadStrikeResponse.Ok()));
var searchScenario = LoadStrikeScenario.Create("search", _ => Task.FromResult(LoadStrikeResponse.Ok()));
var accountScenario = LoadStrikeScenario.Create("account-lookup", _ => Task.FromResult(LoadStrikeResponse.Ok()));

var trafficMix = LoadStrikeTrafficMix.Create("commerce-traffic-mix")
    .WithTotalLoad(
        LoadStrikeSimulation.Inject(1000, TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1))
    )
    .WithScenarioMix(
        LoadStrikeScenarioShare.Create(checkoutScenario, 60),
        LoadStrikeScenarioShare.Create(searchScenario, 30),
        LoadStrikeScenarioShare.Create(accountScenario, 10)
    );

LoadStrikeRunner.RegisterTrafficMix(trafficMix)
    .WithRunnerKey("rkl_your_local_runner_key")
    .Run();

Traffic Mix Parts

Total load

Define the full workload once, such as 1000 requests per second for one minute.

Scenario lanes

Create one scenario per independently weighted business path, endpoint family, or journey.

Weighted shares

Assign ratio weights such as 60, 30, and 10. They do not need to add to 100, but using percentages is often easiest to read.

RegisterTrafficMix / AddTrafficMix

Register the traffic mix when the shared total load owns the lane distribution.

Reports

Each lane appears as a normal scenario in local reports, portal reporting, thresholds, and reporting sinks.

Do not use steps to split traffic. Steps measure operations inside one scenario flow; traffic mix lanes are separate scenarios that receive weighted shares of the shared total load.