feat(coderd/database): add dbrollup service to rollup insights (#12665)

Add `dbrollup` service that runs the `UpsertTemplateUsageStats` query
every 5 minutes, on the minute. This allows us to have fairly real-time
insights data when viewing "today".
This commit is contained in:
Mathias Fredriksson
2024-03-22 18:42:43 +02:00
committed by GitHub
parent 04f0510b09
commit 12e6fbf11e
7 changed files with 479 additions and 5 deletions
+2 -3
View File
@@ -6,10 +6,9 @@ import "hash/fnv"
// change. If locks are deprecated, they should be kept in this list to avoid
// reusing the same ID.
const (
// Keep the unused iota here so we don't need + 1 every time
lockIDUnused = iota
LockIDDeploymentSetup
LockIDDeploymentSetup = iota + 1
LockIDEnterpriseDeploymentSetup
LockIDDBRollup
)
// GenLockID generates a unique and consistent lock ID from a given string.