Skip to main content

Python SDK for in-process load execution, traffic correlation, and reporting.

Project description

LoadStrike SDK for Python

LoadStrike is a developer-first load testing SDK for Python services, jobs, and automated test suites. Use it to describe real workflows in Python, execute them in-process, and collect structured reports from the same codebase that owns the system under test.

What This SDK Is For

  • Author scenario-based load tests in Python.
  • Generate safe starter scenarios from captured HAR, OpenTelemetry trace JSON, browser recordings, or message pairs with Trace-to-test Autopilot.
  • Model transaction flows across HTTP and event-driven systems.
  • Apply load simulations, thresholds, and custom metrics during execution.
  • Split a single load profile across weighted scenario mixes.
  • Generate local reports and, on Enterprise, forward results to supported reporting sinks.

Built-in transport coverage includes HTTP, Kafka, RabbitMQ, NATS, Redis Streams, Azure Event Hubs, Push Diffusion, and delegate-based custom streams. Local report output supports HTML, Markdown, TXT, and CSV, and Enterprise can publish to InfluxDB, TimescaleDB, Grafana Loki, Datadog, Splunk HEC, OpenTelemetry Collector, and the expanded built-in sink family.

Requirements

  • Python 3.9 or later

Install

pip install loadstrike

Quick Start

from loadstrike_sdk import (
    LoadStrikeResponse,
    LoadStrikeRunner,
    LoadStrikeScenario,
    LoadStrikeSimulation,
    LoadStrikeStep,
)


def run_orders(context):
    return LoadStrikeStep.run(
        "publish-order",
        context,
        lambda: LoadStrikeResponse.ok("200"),
    ).as_reply()


scenario = (
    LoadStrikeScenario.create("orders", run_orders)
    .with_load_simulations(LoadStrikeSimulation.inject(10, 1, 20))
)

result = (
    LoadStrikeRunner.register_scenarios(scenario)
    .with_runner_key("rkl_your_runner_key")
    .run()
)

run() returns the detailed run result, including generated report files, scenario statistics, metrics, and sink status.

Traffic Mixes

Use LoadStrikeTrafficMix on Pro and Enterprise plans when one total load profile should be distributed across multiple scenario lanes. For example, a 1000 requests-per-second profile with scenario weights of 60, 30, and 10 sends roughly 600 requests per second to the first scenario, 300 to the second, and 100 to the third.

Each lane is still a normal scenario with its own named steps, thresholds, reports, and portal results. Register the mix with LoadStrikeRunner.register_traffic_mix(...) or add it to a runner with .add_traffic_mix(...).

Trace-To-Test Autopilot

Use LoadStrikeAutopilot.generate(...) to infer a starter plan from a captured artifact. Set RunnerKey on the Autopilot options so generation can validate the Trace-To-Test Autopilot entitlement. Check result.Readiness and result.ReadinessFailures first; call result.build_scenario() only when it is LoadStrikeAutopilotReadiness.Ready, then execute the scenario through the normal runner with a valid RunnerKey.

Use SecretBindings to map redaction locations such as header:Authorization or body:$.client_secret to environment variables, TrackingSelector when the selector cannot be inferred, and EndpointBindings, AllowedReplayHosts, or BaseUrlRewrite when a replay target must be bound. Secret values are resolved when the generated scenario runs; they are not written into the generated plan. Any gate satisfied by user setup is omitted from ReadinessFailures.

Runner Keys

Runnable workloads require a RunnerKey. Supply it with .with_runner_key(...) or through your application configuration before calling run().

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loadstrike-1.0.27301.tar.gz (597.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loadstrike-1.0.27301-py3-none-any.whl (601.7 kB view details)

Uploaded Python 3

File details

Details for the file loadstrike-1.0.27301.tar.gz.

File metadata

  • Download URL: loadstrike-1.0.27301.tar.gz
  • Upload date:
  • Size: 597.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loadstrike-1.0.27301.tar.gz
Algorithm Hash digest
SHA256 cfe2d4016f1ba5679d50ad37e91f6aa6796406bd9e51d6e20e9683c9ea877ff9
MD5 aeef2c60e12d725b273e65aa73cec444
BLAKE2b-256 d3792e871281e9a688172f09b50c46936d515d347502ceb525e6bea86099c698

See more details on using hashes here.

Provenance

The following attestation bundles were made for loadstrike-1.0.27301.tar.gz:

Publisher: main-delivery.yml on Meticulis/LoadStrike

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loadstrike-1.0.27301-py3-none-any.whl.

File metadata

  • Download URL: loadstrike-1.0.27301-py3-none-any.whl
  • Upload date:
  • Size: 601.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loadstrike-1.0.27301-py3-none-any.whl
Algorithm Hash digest
SHA256 96310685e6130eb64197520ba7067119e58e76d09158cdf7045be25abd1fe35d
MD5 cd0175e97a62cee3058d302c24c07aa7
BLAKE2b-256 190af3f9627eec2da5d220cced59f652ad58f0aee4b37b524307d62ba1cff85a

See more details on using hashes here.

Provenance

The following attestation bundles were made for loadstrike-1.0.27301-py3-none-any.whl:

Publisher: main-delivery.yml on Meticulis/LoadStrike

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page