Fuzz#
The fuzz command evaluates an expression thousands of times and reports output statistics: type breakdown, null rate, min/max/mean/median/stddev, a distribution histogram, and unique value count. Use it to catch distribution surprises before seeding millions of rows.
edg fuzz "norm(50, 10, 0, 100)"Expression: norm(50, 10, 0, 100)
Iterations: 10000
Type Count Pct
float64 10000 100.0%
Nulls: 0 (0.0%)
Panics: 0
Errors: 0
Unique: 71
Min: 14
Max: 86
Mean: 50.01
Median: 50
Stddev: 10.02
p50: 50
p90: 63
p95: 67
p99: 73
Distribution:
14 - 21.2 25 (0.2%)
21.2 - 28.4 █ 134 (1.3%)
28.4 - 35.6 ███████ 586 (5.9%)
35.6 - 42.8 ████████████████████ 1539 (15.4%)
42.8 - 50 ██████████████████████████████████ 2510 (25.1%)
50 - 57.2 ████████████████████████████████████████ 2937 (29.4%)
57.2 - 64.4 ████████████████████ 1530 (15.3%)
64.4 - 71.6 ███████ 584 (5.8%)
71.6 - 78.8 █ 131 (1.3%)
78.8 - 86 24 (0.2%)Flags#
| Flag | Default | Description |
|---|---|---|
-n / --iterations | 10000 | Number of times to evaluate the expression |
--config | Optional workload config for globals, references, and user-defined expressions |
Loading Config#
When you need access to globals, references, or user-defined expressions, pass a config file:
edg fuzz "norm(warehouses * 5, warehouses, 0, warehouses * 10)" --config workload.edg -n 5000Null Rate Checking#
Use fuzz to verify that nullable() produces the expected null rate:
edg fuzz "nullable(0.1, gen('name'))" -n 10000The output will show Nulls: ~1000 (10.0%) confirming the 10% null rate.
Distribution Comparison#
Compare distribution shapes by fuzzing different expressions:
# Uniform - flat histogram
edg fuzz "uniform(1, 1000)"
# Normal - bell curve centered at 50
edg fuzz "norm(50, 10, 0, 100)"
# Normal float with 2 decimal places
edg fuzz "norm_f(50, 10, 0, 100, 2)"
# N unique normal values
edg fuzz "norm_n(50, 10, 0, 100, 3, 5)"
# Zipfian - heavy left skew (hot keys)
edg fuzz "zipf(2.0, 1.0, 1000)"
# Exponential - recent bias
edg fuzz "exp(0.5, 0, 100)"
# Exponential float with 2 decimal places
edg fuzz "exp_f(0.5, 0, 100, 2)"
# Log-normal
edg fuzz "lognorm(1, 0.5, 0, 100)"
# Log-normal float with 2 decimal places
edg fuzz "lognorm_f(1, 0.5, 0, 100, 2)"
# Pareto - power-law, values near 0
edg fuzz "pareto(2.0, 1000)"