You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,14 @@
2
2
3
3
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
5
+
## [Unreleased]
6
+
7
+
### Added
8
+
9
+
-`dbt-dag-opt replay` subcommand: reconstructs the observed schedule from `run_results.json`'s `thread_id` + per-phase `timing` data, joined against `manifest.json`'s `parent_map`. Reports per-thread utilization, observed critical path (walked backwards from the last-completing node), and top idle gaps with parent-node attribution.
10
+
- Output formats for `replay`: `text` (rich terminal summary, default) and `json` (full replay report, including raw events).
11
+
- Integration fixture at `tests/fixtures/dbt_dugout/` — a real Snowflake dbt run (57 nodes, 4 threads) used to smoke-test `replay` end-to-end.
12
+
5
13
## [0.1.0] - 2026-04-24
6
14
7
15
Initial PyPI release. Complete rewrite of the pre-release prototype.
Copy file name to clipboardExpand all lines: README.md
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,8 @@ Add `--run-id <id>` to pull artifacts from a specific historical run instead of
53
53
54
54
## CLI reference
55
55
56
+
### `analyze` — critical path through the DAG
57
+
56
58
```
57
59
dbt-dag-opt analyze [OPTIONS]
58
60
@@ -68,11 +70,31 @@ dbt-dag-opt analyze [OPTIONS]
68
70
-o, --output PATH Write output to a file instead of stdout
69
71
```
70
72
73
+
### `replay` — what actually happened
74
+
75
+
`analyze` is theoretical — it reports the DAG-structural lower bound on wall-clock. `replay` reads the *observed* schedule. Every result in `run_results.json` carries a `thread_id` and per-phase `timing` with start/end timestamps, so we can reconstruct:
76
+
77
+
-**Per-thread utilization** — how much of the run each worker was busy vs. idle.
78
+
-**Observed critical path** — the chain of nodes that actually determined wall-clock, walked backwards from the last-completing node.
79
+
-**Idle-gap attribution** — for every stretch of idle time, which upstream node's completion unblocked the thread. Gaps with no blocker are scheduler overhead, not DAG blocking.
80
+
81
+
```
82
+
dbt-dag-opt replay [OPTIONS]
83
+
84
+
--manifest PATH Path to manifest.json (file mode)
85
+
--run-results PATH Path to run_results.json (file mode)
86
+
--account-id / --job-id dbt Cloud mode (same as analyze)
87
+
-f, --format [text|json] Output format [default: text]
88
+
--top-idle-gaps INTEGER How many idle gaps to surface [default: 10]
89
+
-o, --output PATH Write output to a file instead of stdout
90
+
```
91
+
71
92
### Output formats
72
93
73
-
-`table` — rich terminal table (default; what you want in a shell).
74
-
-`json` — one object keyed by source: `{source_id: {path, distance, length}}`. Valid JSON, safe to pipe through `jq`.
75
-
-`jsonl` — one JSON object per line. Nice for streaming into a log aggregator.
94
+
-`table` — rich terminal table (default for `analyze`).
95
+
-`text` — rich-rendered summary (default for `replay`): run summary, per-thread utilization, observed critical path, top idle gaps.
96
+
-`json` — `analyze` emits `{source_id: {path, distance, length}}`; `replay` emits the full replay report. Both are `jq`-friendly.
97
+
-`jsonl` — one JSON object per line (`analyze` only).
76
98
77
99
## How it works
78
100
@@ -85,11 +107,11 @@ Distances sum the execution time of every node along the path — that's the war
85
107
86
108
## What this is / isn't
87
109
88
-
It **is** a CLI tool that points at the slowest chains in your DAG.
110
+
It **is** a CLI tool that points at the slowest chains in your DAG and — as of `replay` — the observed schedule that those chains actually produced.
89
111
90
112
It **isn't** (yet):
91
-
- A scheduler simulator. If your dbt `threads` setting is low, total wall-clock is bounded by parallelism *and* the critical path; v0.2 will surface both. For now, treat the critical-path distance as a lower bound.
92
-
- A cost model. Multiplying distance × your warehouse rate is on you — a `--warehouse-size` flag is planned for v0.3.
113
+
- A predictive scheduler simulator. `replay` reconstructs what already happened; it doesn't yet project what would happen under a different `--threads N` or if you sped up a specific model. That "what-if" loop is planned next.
114
+
- A cost model. Multiplying wall-clock × your warehouse rate is on you — a `--warehouse-size` flag is planned alongside the what-if loop.
0 commit comments