Add opt-in slow SQL and database diagnostics

This commit is contained in:
2026-10-06 13:56:27 -04:00
parent dd2fe2cc7a
commit 8e948c07d9
7 changed files with 80 additions and 1 deletions
+7
View File
@@ -184,6 +184,13 @@ record an `ec:navigation` performance measure. `npm run benchmark:leaderboard`
uses an isolated synthetic database; pass `-- --scenario all --baseline-ref <commit>`
to compare full response parity and warm query timings with an earlier revision.
Set `EC_SLOW_SQL_MS=20` to log runtime statements taking at least 20 ms; bound
values and string literals are omitted. It is disabled by default. Before and
after database changes, capture these timings under the same fleet load and run
`npm run diagnostics:database -- /data/cherry.db` inside the controller to report
the largest tables/indexes, database and WAL sizes, and free pages. This command
opens an existing database read-only and does not run app migrations.
Local controller
metadata defaults to `./data/cherry.db`; use a separate test database when
exercising enrollment. Production agent transport requires HTTPS.