-
Notifications
You must be signed in to change notification settings - Fork 881
feat(coderd/database): use template_usage_stats
in GetTemplateAppInsights
query
#12669
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
f369461
to
2eae8f8
Compare
7fa004c
to
d384842
Compare
2eae8f8
to
4ae3521
Compare
d384842
to
c10b34b
Compare
wa.agent_id = was.agent_id | ||
AND wa.slug = was.slug_or_port | ||
WITH | ||
app_insights AS ( |
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.
nit: you may want to drop a comment here, many joins around
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.
Hmm, in my opinion it's a self-contained sequence of joins and there is a comment inline, is there something more you would like explained in the comment? This is a common pattern when we need to lookup agent (or in our case app) -> template association.
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, exactly this :)
prevent going through joins and "fast-forward" reading query code by human
4ae3521
to
2ac8855
Compare
c10b34b
to
c45caeb
Compare
eb52bb7
to
37f6f3a
Compare
c45caeb
to
d481905
Compare
37f6f3a
to
70ba902
Compare
3d14fe4
to
04b5c07
Compare
70ba902
to
4d27721
Compare
11871be
to
8a9eb15
Compare
4d27721
to
53a54b0
Compare
8a9eb15
to
772aa60
Compare
772aa60
to
460c244
Compare
a234c5d
to
02b3828
Compare
460c244
to
87f22f1
Compare
958785d
to
05780db
Compare
2cf5f94
to
02d0f24
Compare
05780db
to
3c67005
Compare
02d0f24
to
dfa069b
Compare
3c67005
to
bf27a9f
Compare
dfa069b
to
6fca988
Compare
bf27a9f
to
8b32a8c
Compare
6fca988
to
0cd1f85
Compare
GetTemplateAppInsights
to use template_usage_stats
template_usage_stats
in GetTemplateAppInsights
query
8b32a8c
to
bfe4b8a
Compare
0cd1f85
to
549a837
Compare
bfe4b8a
to
cb74f29
Compare
549a837
to
6813b73
Compare
This PR updates the
GetTemplateAppInsights
query to use rolled uptemplate_usage_stats
instead of raw agent and app stats.