mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
0ec9df390b
see https://github.com/coder/internal/issues/959 but the tl; dr is: - we call this DB query on an interval (every 15s) and it would be called on each coderd replica as well - the generated values update very infrequently (for our most used internal template I saw the builds created/claimed update twice in a 1h period) - we have no index on the initiator ID, so this query has to scan the entire workspace_builds table on every request In reality this should likely just be a Prometheus metric, and Prometheus can handle the counter reset behaviour at query time, but for now this should at least cut the load of the query to 25% of it's current impact. --------- Signed-off-by: Callum Styan <callumstyan@gmail.com>