Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b183236

Browse files
authored
feat(coderd/database): use template_usage_stats in *ByTemplate insights queries (#12668)
This PR updates the `*ByTempalte` insights queries used for generating Prometheus metrics to behave the same way as the new rollup query and re-written insights queries that utilize the rolled up data.
1 parent 01f9a9a commit b183236

File tree

7 files changed

+332
-289
lines changed

7 files changed

+332
-289
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ func (q *FakeQuerier) GetTemplateAppInsightsByTemplate(ctx context.Context, arg
32803280
for _, usageKey := range usageKeys {
32813281
r := database.GetTemplateAppInsightsByTemplateRow{
32823282
TemplateID: usageKey.TemplateID,
3283-
DisplayName: sql.NullString{String: usageKey.DisplayName, Valid: true},
3283+
DisplayName: usageKey.DisplayName,
32843284
SlugOrPort: usageKey.Slug,
32853285
}
32863286
for _, mUserUsage := range usageByTemplateAppUser[usageKey] {

coderd/database/querier.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 116 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)