Turns a reviewed experiment manifest into durable runs, append-only events, verified artifacts, and comparable results.
- Asynchronous, resumable execution
- Typed MCP operations for AI agents
- Immutable plans and artifact hashes
Configure, provision, load, benchmark, diagnose, and compare with one composable toolchain built for DBAs, performance engineers, developers, and AI agents.
01 / THE ECOSYSTEM
Use each utility independently from the command line, or install
the current pg_play source to bring the complete
PostgreSQL stack into one recoverable workflow. Cards describe
current source; PyPI versions identify the latest published
packages installed by the commands below.
Turns a reviewed experiment manifest into durable runs, append-only events, verified artifacts, and comparable results.
Converts hardware limits, workload shape, topology, and server version into a reviewable configuration candidate.
Creates disposable but realistic database environments with managed images, bounded resources, logs, and persistent evidence.
Produces realistic plans, logs, locks, and runtime statistics through editable, deterministic workload profiles.
Sweeps concurrency, measures saturation, and keeps the workload, configuration, host, and raw execution evidence together.
Collects database and Linux evidence locally or over SSH, then produces portable reports for humans and automation.
Applies versioned SQL and Python packets—migrations, operational, and diagnostic tasks—to one or many PostgreSQL 10–18 databases.
02 / THE WORKFLOW
The toolkit preserves the context around every result, so a faster run is evidence—not an anecdote.
Describe the stand, workload, limits, and expected artifacts.
Provision safely, apply a candidate, and execute bounded workloads.
Capture TPS, database state, CPU, memory, disk, network, and logs.
Join only compatible reports and isolate the variable that changed.
Configuration, workload source, generated data, client version, host facts, and collection diagnostics travel with the report. Incompatible experiments are rejected before they distort a chart.
# initialize editable component assets
$ pg-stand init --directory stand
$ pg-workload init --directory workload
# validate and review the complete experiment
$ pg-play validate experiment.yaml
$ pg-play plan experiment.yaml > plan.json
# start the unchanged plan in a durable worker
$ pg-play start experiment.yaml --plan-hash sha256:... --run-id baseline-001
$ pg-play status experiment.yaml --run-id baseline-001
# compare compatible benchmark artifacts
$ pg-play compare-benchmark-reports baseline.json candidate.json
03 / THE ARTIFACT
pg-diag and pg-perf-bench make
structured JSON the durable automation artifact and render
self-contained HTML alongside it.
Collected items keep their columns, types, rows, and collection status. The content checksum binds the report to the exact query pack that produced it—so two reports can be compared safely.
{
"artifact_schema_version": 4,
"generator": { "name": "pg_diag", "version": "0.10.5" },
"content": {
"checksum": "sha256:9a846631…fefc7f8e8",
"report_id": "pg_diag_minimal"
},
"items": {
"activity_locks.lock_modes": {
"collection_status": "ok",
"result": {
"kind": "table",
"columns": [
{ "name": "locktype", "pg_type": "text" },
{ "name": "mode", "pg_type": "text" },
{ "name": "granted", "pg_type": "bool" },
{ "name": "locks", "pg_type": "int8", "unit": "count" }
],
"row_count": 4,
"rows": [
["virtualxid", "ExclusiveLock", true, "3"],
["relation", "ShareUpdateExclusiveLock", true, "2"]
]
}
}
}
}
04 / AI-READY
pg-play-mcp exposes the whole stack as typed MCP
operations—no arbitrary shell, SQL, or Docker access.
High-level operations cover experiment lifecycles, live diagnostics, configuration reviews, converter runs, and artifact comparison. Calls are schema-validated, plans are hashed before execution, and durable runs are resumable.
→ tool call
{
"name": "plan_experiment",
"arguments": { "manifest": "experiments/pg18-candidate.yaml" }
}
← tool result
{
"schema_version": "pg_play/plan-v1",
"experiment_id": "pg18-candidate-03",
"plan_hash": "sha256:4be2…9d01",
"phases": {
"benchmark": true,
"workload_diagnostics": true,
"recreate_workload_database": true
}
}
05 / ENGINEERING PRINCIPLES
Results carry their inputs, environment, versions, raw output, timestamps, and collection status.
Read-only diagnostics, explicit disposable databases, resource guards, and reviewed deployment plans.
Stable CLIs, versioned schemas, structured JSON, portable HTML, and typed MCP operations.
START WITH THE LATEST RELEASE
PyPI 0.2.1 · source 0.3.0 · Python 3.10+ · PostgreSQL 10–18 · Linux