CLI Reference#

Commands#

CommandDescription
edg <expression>Evaluate a single expression and print the result
upCreate schema (tables, indexes)
seedPopulate tables with initial data
runExecute the benchmark workload
deseedDelete seeded data (truncate tables)
downTear down schema (drop tables)
allRun up, seed, run, deseed, and down in sequence
replInteractive expression evaluator

Running edg with an expression (no subcommand) evaluates it and prints the result. Bare words are treated as gofakeit patterns, so edg email is equivalent to edg "gen('email')". For expressions with parentheses or special characters, quote the argument.

A typical workflow runs the commands in order: up -> seed -> run -> deseed -> down. The all command runs this entire sequence in a single invocation.

Flags#

FlagShortDefaultDescription
--urlDatabase connection URL (or set URL env var)
--configPath to the workload YAML config file (required for database commands, optional for repl)
--driverpgxdatabase/sql driver name (pgx, oracle, or mysql)
--duration-d1mBenchmark duration (run and all commands)
--workers-w1Number of concurrent workers (run and all commands)
--print-interval1sProgress reporting interval (run and all commands)

Example#

edg up \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable"

edg seed \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable"

edg run \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 100 \
-d 1m

edg deseed \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable"

edg down \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable"

Or use all to run the entire workflow in one command:

edg all \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 100 \
-d 5m

Run Behaviour#

Workers and Initialisation#

Each worker gets its own isolated environment. The init section runs once, and its results are cloned to each worker so that functions like ref_rand and ref_diff don’t interfere across workers. Per-worker state includes sequence counters (seq), permanent row picks (ref_perm), and NURand constants.

Error Handling#

Query errors during run are non-fatal. The worker logs the error and increments an error counter but continues to the next iteration. This lets you observe error rates without aborting the benchmark. Errors in other sections (up, seed, deseed, down, init) are fatal and stop execution immediately.

Interrupting with Ctrl+C#

Pressing Ctrl+C during run or all cancels the workload gracefully. Workers finish their current iteration and stop. When using all, the cleanup phases (deseed and down) still run after interruption, using a fresh context.

Output#

During the run, progress is printed at the --print-interval (default: every second):

5s elapsed
QUERY       COUNT  ERRORS  AVG LATENCY  QPS
get_user    4820   0       1.037ms      964.0

After all workers complete, a final summary is printed:

summary
Duration:  1m0.001s
Workers:   10

QUERY       COUNT   ERRORS  AVG LATENCY  QPS
get_user    58241   0       1.028ms      970.7

Transactions:  58241
Errors:        0
tpm:           3494460.0
MetricDescription
COUNTTotal successful query executions
ERRORSTotal failed query executions
AVG LATENCYMean execution time per query
QPSQueries per second (count / elapsed seconds)
tpmTransactions per minute across all queries