feat(coderd/database): add dbrollup service to rollup insights#12665
Merged
Conversation
Member
Author
This was referenced Mar 19, 2024
Merged
Closed
5a49791 to
c9fe7c5
Compare
6364b79 to
dcc3811
Compare
johnstcn
reviewed
Mar 20, 2024
| @@ -0,0 +1,127 @@ | |||
| package dbrollup | |||
Member
There was a problem hiding this comment.
I see a potential abstraction here -- the PR I'm working on in parallel #12659 has a similar logic of "run a query every interval". There are definitely other areas of the codebase that could benefit from a similar framework.
| } | ||
| } | ||
|
|
||
| func (r *Rolluper) Close() error { |
Member
There was a problem hiding this comment.
Is the error return value here to satisfy an interface? Do we need it?
Member
Author
There was a problem hiding this comment.
Yeah, I feel the io.Closer interface is so common it's worth using this signature even if the error is not used at the moment or ever in the future.
johnstcn
reviewed
Mar 20, 2024
mtojek
approved these changes
Mar 20, 2024
c9fe7c5 to
46bc0f0
Compare
7fc6fb5 to
91fb8e4
Compare
b64c291 to
b3bdea2
Compare
32a5d2c to
e77ca25
Compare
df37ae9 to
cafcc7b
Compare
28c5885 to
4374753
Compare
8f207e3 to
310f545
Compare
4374753 to
7145189
Compare
310f545 to
fc0b87c
Compare
7145189 to
c2926ef
Compare
fc0b87c to
cba0c08
Compare
c2926ef to
8ccae5f
Compare
cba0c08 to
8b96a59
Compare
8ccae5f to
c8221f3
Compare
Member
Author
Base automatically changed from
mafredri/add-template-usage-stats-table-and-rollup-query
to
main
March 22, 2024 16:33
c8221f3 to
2040b87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds the dbrollup service that runs the
UpsertTemplateUsageStatsquery every 5 minutes, on the minute. This allows us to have fairly real-time data when viewing "today".