Names what is slow in the database, in the log.
- A slow query: one that ran, or waited for a pool connection, longer
than
GAMEND_DB_SLOW_QUERY_MS(default 1000). - A long transaction: one that held its connection, from
begintocommitorrollback, longer thanGAMEND_DB_SLOW_TRANSACTION_MS(default 2000). On SQLite that connection holds the one write lock (transactions areIMMEDIATE), so this is the line that explains a "database is locked": those errors name the process that waited, never the one it waited for.
Each line has the time, the table, the SQL (trimmed) and where in the code
it came from: the first frames outside Ecto and DBConnection. 0 turns
either off. The settings are read when the handler attaches, at boot
(GamendWeb.HostSupervision.init_runtime/1); a change takes a restart.
The handler runs inside every query, in the caller's process, so it only compares two integers unless something was slow.