mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd/database): add template_usage_stats table and rollup query (#12664)
Add `template_usage_stats` table for aggregating tempalte usage data. Data is rolled up by the `UpsertTemplateUsageStats` query, which fetches data from the `workspace_agent_stats` and `workspace_app_stats` tables.
This commit is contained in:
@@ -48,6 +48,9 @@ sql:
|
||||
- column: "template_with_users.group_acl"
|
||||
go_type:
|
||||
type: "TemplateACL"
|
||||
- column: "template_usage_stats.app_usage_mins"
|
||||
go_type:
|
||||
type: "StringMapOfInt"
|
||||
rename:
|
||||
template: TemplateTable
|
||||
template_with_user: Template
|
||||
|
||||
Reference in New Issue
Block a user