Bench Datastore
Datastore benchmarking harness for swamp. Two workflow-based test scenarios that exercise any swamp datastore backend under sustained load without lock contention.
Scenario A: Throughput (breadth)
Each worker owns isolated models. Cycles through write → read → query operations measuring per-step latency. Tests: sync push/pull speed, chunked storage, GSI queries, workflow overhead.
Scenario B: Write Stress (depth)
Each worker owns one model, writes continuously with varying payload sizes. Tests: sustained single-writer throughput, version accumulation, chunked vs inline performance, hot-partition behavior.
Usage
swamp extension pull @webframp/bench-datastore
# Create harness instance for worker 1 (throughput scenario)
swamp model create @webframp/bench-datastore/harness bench-harness-w001 \
--global scenario=throughput --global worker_id=1 --global models_per_worker=50
# Setup (creates worker-owned models)
swamp model method run bench-harness-w001 setup
# Run throughput cycle once
swamp workflow run @webframp/bench-throughput-cycle \
--input harness_model=bench-harness-w001 \
--input probe_model=bench-probe-w001 \
--input iteration=1
# Run write-stress once
swamp workflow run @webframp/bench-write-stress \
--input harness_model=bench-harness-w001 \
--input probe_model=bench-probe-w001 \
--input iteration=1Both workflows are designed to be called in a tight loop by an ECS Fargate worker or local script. Duration is controlled by the caller.
2026.08.28.1
Changed: Normalized the extension license to Apache-2.0 and corrected the copyright holder to "Sean Escriva". Extensions that previously shipped an MIT LICENSE.md are now Apache-2.0, consistent with the repository root and every other extension. No code or behavioral changes.
Upgrade note: License text only. No API, schema, or runtime behavior changed.
2026.08.27.1
Changed: Test suite now builds its method context from the shared
createModelTestContext factory in @systeminit/swamp-testing, replacing the
per-test inline contexts with a single makeContext helper that wraps
writeResource to preserve the existing assertion API. The local
spawn()-aware withMockedCommand is retained. No behavioral, schema, or
method changes — the published harness is unchanged. The deno.json gains a
dev-only @systeminit/swamp-testing import-map entry.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
Resources
Single iteration of the throughput benchmark. Executes one model method (rotated by iteration), then reads back the data and checks datastore health. Designed to be called in a tight loop by an ECS worker. Measures: write latency, read latency, datastore health, and workflow orchestration overhead.
Single iteration of the write-stress benchmark. Writes a payload of configured size to the worker's model, then reads it back to verify. Designed to be called in a tight loop with no sleep between iterations. Payload sizes rotate: small (100B), medium (10KB), large (500KB+). Large payloads exercise the chunked storage path. Measures: write throughput, chunk handling, version accumulation, read-after-write latency, sustained single-writer performance.
2026.08.27.1
Changed: Test suite now builds its method context from the shared
createModelTestContext factory in @systeminit/swamp-testing, replacing the
per-test inline contexts with a single makeContext helper that wraps
writeResource to preserve the existing assertion API. The local
spawn()-aware withMockedCommand is retained. No behavioral, schema, or
method changes — the published harness is unchanged. The deno.json gains a
dev-only @systeminit/swamp-testing import-map entry.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
2026.08.26.1
Fixed: Added missing description field to upgrade entry for version
2026.08.24.2. The omission caused swamp extension pull to fail with a catalog
validation error ("upgrades.N.description: Invalid input: expected string,
received undefined").
2026.08.24.3
Added: Output metadata attributes for observability.
durationMs: Method execution duration in milliseconds.collectedBy: Extension name that produced the data.fetchedAt: ISO 8601 timestamp when data was fetched (added to resources that previously lacked it).
2026.08.24.2
Fixed development section to use standard deno commands. Added Troubleshooting section documenting intentional no-retry design, setup idempotency, subprocess timeout absence, correct --global-arg flag, and external datastore selection.
2026.08.21.1
Changed: When a benchmark write iteration fails, the recorded errorMessage
now names the target model and payload size instead of surfacing the bare
stderr from the inner swamp data write command. A command that failed with
no stderr output previously produced an empty error message; it now says so
explicitly.
2026.07.27.1
Fixed: The fmt task ran deno fmt --check, so deno task fmt verified
formatting instead of applying it and there was no way to format the extension
through its own task. fmt now formats and a new fmt:check verifies, matching
every other extension in the repository.
Fixed: deno fmt no longer inspects CLAUDE.md / AGENTS.md. Those files
are gitignored and never present in CI, but deno fmt does not read .gitignore,
so deno task fmt:check could fail locally on a file CI does not have.
Upgrade note: Tooling and formatting only. No model, method, schema, or behavior change — nothing to do on upgrade.
2026.07.27.1
Fixed: The fmt task ran deno fmt --check, so deno task fmt verified
formatting instead of applying it and there was no way to format the extension
through its own task. fmt now formats and a new fmt:check verifies, matching
every other extension in the repository.
Fixed: deno fmt no longer inspects CLAUDE.md / AGENTS.md. Those files
are gitignored and never present in CI, but deno fmt does not read .gitignore,
so deno task fmt:check could fail locally on a file CI does not have.
Upgrade note: Tooling and formatting only. No model, method, schema, or behavior change — nothing to do on upgrade.
2026.07.24.1
Added: Initial release of the datastore benchmarking harness.
- Two workflow-based scenarios: throughput (breadth) and write-stress (depth)
- Zero lock contention by construction — each worker owns isolated models
- Backend-agnostic measurement of datastore I/O independent of swamp core locking
- Configurable at runtime via workflow inputs (scenario, worker count, duration controlled by caller)
- Deployable on ECS Fargate or runnable locally
- Payload delivery uses stdin streaming via temp files to avoid Linux MAX_ARG_STRLEN (131072 bytes) limit on large (500KB) write-stress payloads
- Probe measurements in workflows are scoped to the worker's harness model via
--modelfilter to prevent cross-worker data inflation under concurrent load payload_sizeaccepted as an optional workflow input on bench-write-stress for controlled single-size runs
Added 1, removed 1, modified 1 workflows
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned