PublicDashboards: metrics collected in background service (#65836)

This commit is contained in:
juanicabanas
2023-04-11 14:36:50 -03:00
committed by GitHub
parent 1ed75f9709
commit 92e591d2e1
12 changed files with 232 additions and 20 deletions

View File

@@ -124,9 +124,7 @@ func (ss *sqlStatsService) GetSystemStats(ctx context.Context, query *stats.GetS
sb.Write(`(SELECT COUNT(id) FROM `+dialect.Quote("library_element")+` WHERE kind = ?) AS library_variables,`, model.VariableElement)
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("data_keys") + `) AS data_keys,`)
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("data_keys") + `WHERE active = true) AS active_data_keys,`)
// TODO: table name will change and filter should check only for is_enabled = true
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("dashboard_public") + `WHERE is_enabled = true) AS public_dashboards,`)
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("dashboard_public") + `) AS public_dashboards,`)
sb.Write(ss.roleCounterSQL(ctx))