S
Synthetic data
Data sources & feeders availableGenerate deterministic synthetic feeder rows — names, emails, UUIDs, numbers.
$ loadr plugin install faker-gen
# Synthetic data-driven login, fed by the `faker-gen` service plugin.
#
# faker-gen is NOT built into loadr core — it is a runtime-loadable *service*
# plugin. On start it generates a seeded CSV of fake rows at `config.path`; a
# plain CSV feeder then pulls those rows exactly like any hand-written fixture,
# so every VU gets realistic, parameterised data with no committed data file.
#
# Determinism: `seed` fixes the data so re-runs are byte-for-byte identical.
# Drop `seed` for fresh random data on every run.
#
# Build + install the plugin, then run:
# cargo build -p loadr-plugin-faker-gen --release
# mkdir -p dist && cp plugins/loadr-plugin-faker-gen/plugin.toml dist/ \
# && cp target/release/libloadr_plugin_faker_gen.so dist/
# loadr plugin install dist
# loadr run examples/plugins/faker-gen.yaml
#
# Or point the plan's `plugins:` entry at the built artifact directly with
# `path: target/release/libloadr_plugin_faker_gen.so`.
name: faker-gen-login
description: CSV login flow parameterised by seeded, generated fake data
defaults:
http:
base_url: https://shop.example.com
plugins:
# Resolve `faker-gen` by name from the plugins dir (after `loadr plugin
# install`). The service writes `data/generated-users.csv` before the run.
- name: faker-gen
config:
path: data/generated-users.csv
rows: 5000
seed: 42 # reproducible; omit for fresh data each run
cleanup: false # keep the file after the run (set true to tidy up)
columns:
- { name: id, type: uuid }
- { name: username, type: username }
- { name: email, type: email }
- { name: full_name, type: full_name }
- { name: age, type: int, min: 18, max: 80 }
- { name: city, type: city }
- { name: country, type: country }
- { name: active, type: bool }
data:
# The CSV the plugin generated above. Columns become `${data.users.<name>}`.
users:
type: csv
path: data/generated-users.csv
mode: shared # all VUs share one cursor
on_eof: recycle # wrap around at EOF
scenarios:
login_flow:
executor: per-vu-iterations
vus: 20
iterations: 50
flow:
- request:
name: register
method: POST
url: /register
body:
json:
id: ${data.users.id}
username: ${data.users.username}
email: ${data.users.email}
name: ${data.users.full_name}
age: ${data.users.age}
checks:
- { type: status, one_of: [200, 201] }
- request:
name: login
method: POST
url: /login
body:
form:
username: ${data.users.username}
password: hunter2
extract:
- { type: jsonpath, name: token, expression: "$.token" }
assert:
- { type: status, equals: 200 }
- request:
name: profile
url: /me
headers:
Authorization: Bearer ${token}
checks:
- { type: status, equals: 200 }
- { type: jsonpath, name: correct user, expression: "$.username", equals: "${data.users.username}" }
thresholds:
checks: [ "rate>0.99" ]
http_req_duration: [ "p(95)<400" ]
A real run: install from the signed index, then watch the plugin work.
A runtime plugin, never in the binary
Installing pulls a per-platform driver from the signed index, verifies its SHA-256 and checks its ABI before it ever loads. Remove it any time with loadr plugin remove faker-gen.