Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(coderd/database): add template_usage_stats table and rollup query #12664

Merged

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Mar 19, 2024

This PR adds a new table, template_usage_stats containing aggregate usage data from users and what features they've used.

The rollup is performed by the UpsertTemplateUsageStats query and it fetches data from the workspace_agent_stats and workspace_app_stats tables.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any blocking comments here, except for the potential of a golden-style test for this query. Will approve once CI is happy 👍 Nice work!

coderd/database/queries/insights.sql Show resolved Hide resolved
@mafredri
Copy link
Member Author

I don't have any blocking comments here, except for the potential of a golden-style test for this query. Will approve once CI is happy 👍 Nice work!

Thanks for the review. The golden file verifications will come via existing tests in: #12673

(Although I'm planning on moving that PR around a bit in this stack.)

coderd/database/queries/insights.sql Show resolved Hide resolved
coderd/database/dbmem/dbmem.go Outdated Show resolved Hide resolved
coderd/database/queries/insights.sql Show resolved Hide resolved
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch from c9fe7c5 to 46bc0f0 Compare March 20, 2024 10:25
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch 2 times, most recently from b64c291 to b3bdea2 Compare March 20, 2024 13:56
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch from df37ae9 to cafcc7b Compare March 20, 2024 19:03
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch from 8f207e3 to 310f545 Compare March 20, 2024 19:55
@mafredri mafredri marked this pull request as ready for review March 20, 2024 20:05
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch 2 times, most recently from fc0b87c to cba0c08 Compare March 21, 2024 17:53
@mafredri mafredri force-pushed the mafredri/add-template-usage-stats-table-and-rollup-query branch from cba0c08 to 8b96a59 Compare March 22, 2024 15:40
Copy link
Member Author

mafredri commented Mar 22, 2024

Merge activity

  • Mar 22, 12:33 PM EDT: @mafredri started a stack merge that includes this pull request via Graphite.
  • Mar 22, 12:33 PM EDT: @mafredri merged this pull request with Graphite.

@mafredri mafredri merged commit 04f0510 into main Mar 22, 2024
23 checks passed
@mafredri mafredri deleted the mafredri/add-template-usage-stats-table-and-rollup-query branch March 22, 2024 16:33
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants