-
Notifications
You must be signed in to change notification settings - Fork 881
feat(coderd/database): add dbrollup
service to rollup insights
#12665
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
Conversation
5a49791
to
c9fe7c5
Compare
6364b79
to
dcc3811
Compare
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.
👍 once CI is happy
@@ -0,0 +1,127 @@ | |||
package dbrollup |
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 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 { |
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 the error return value here to satisfy an interface? Do we need it?
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.
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.
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
c8221f3
to
2040b87
Compare
This PR adds the dbrollup service that runs the
UpsertTemplateUsageStats
query every 5 minutes, on the minute. This allows us to have fairly real-time data when viewing "today".