-- Ported from the SQLite migration of the same number. -- What a request went through, beside what it cost: which replica answered, -- how long it queued in admission, and how long the first token took. Without -- them "why was my request slow" had no answer — the queue time went out in a -- response header and nowhere else. -- -- request_id is the id the client sent or the gateway made, echoed in the -- X-Request-Id header and the access log, so one request can be followed from -- the client's error to the replica that served it. ALTER TABLE usage ADD COLUMN request_id TEXT NOT NULL DEFAULT ''; ALTER TABLE usage ADD COLUMN replica TEXT NOT NULL DEFAULT ''; ALTER TABLE usage ADD COLUMN queue_ms BIGINT NOT NULL DEFAULT 0; ALTER TABLE usage ADD COLUMN ttft_ms BIGINT NOT NULL DEFAULT 0; CREATE INDEX usage_by_request ON usage(request_id) WHERE request_id <> '';