-
Notifications
You must be signed in to change notification settings - Fork 889
feat(coderd): add template app usage to insights #9138
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): add template app usage to insights #9138
Conversation
appUsage, err = tx.GetTemplateAppInsights(ctx, database.GetTemplateAppInsightsParams{ | ||
StartTime: startTime, | ||
EndTime: endTime, | ||
TemplateIDs: templateIDs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint: while you are writing unit tests, please make sure that cover paths with TemplateIDs
and without them (ALL).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create an improved test-suite as a follow-up to this PR which will perform tests for multiple templates as well.
This reverts commit 77e8382.
7707313
to
cacebb9
Compare
I've added basic tests and will improve upon them in a follow up PR. I've also manually confirmed that the query changes produces the same data on A funny side-effect of using the 5 minute windows is that when testing, I:
More users will skew nr. 4 even more, so I'm convinced we need to reduce the window whilst maintaining or improving query performance, and perhaps not use one at all for template apps since it's not strictly required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything left for @BrunoQuaresma to polish in the site area?
This PR adds template app usage to insights. Once merged, the dashboard will automatically start showing these.
Fixes #8658
Notable changes:
generate_series
a bit via bettersqlc
workaroundNotes:
GetTemplateInsights
andGetTemplateAppInsights
into a single query because ofsqlc
limitations, and I did not want to trade type-safety for performance