mirror of
https://github.com/grafana/grafana.git
synced 2026-08-14 07:04:57 -05:00
Analytics: Add total dashboard byte size to reporting (#66425)
Co-authored-by: Dan Cech <dcech@grafana.com>
This commit is contained in:
co-authored by
Dan Cech
parent
1b46d2f5bd
commit
fef490e4f8
@@ -2,6 +2,8 @@ package stats
|
||||
|
||||
type SystemStats struct {
|
||||
Dashboards int64
|
||||
DashboardBytesTotal int64
|
||||
DashboardBytesMax int64
|
||||
Datasources int64
|
||||
Users int64
|
||||
ActiveUsers int64
|
||||
|
||||
@@ -89,6 +89,8 @@ func (ss *sqlStatsService) GetSystemStats(ctx context.Context, query *stats.GetS
|
||||
notServiceAccount(dialect)+` AND last_seen_at > ?) AS monthly_active_users,`, monthlyActiveUserDeadlineDate)
|
||||
|
||||
sb.Write(`(SELECT COUNT(id) FROM `+dialect.Quote("dashboard")+` WHERE is_folder = ?) AS dashboards,`, dialect.BooleanStr(false))
|
||||
sb.Write(`(SELECT SUM(LENGTH(data)) FROM `+dialect.Quote("dashboard")+` WHERE is_folder = ?) AS dashboard_bytes_total,`, dialect.BooleanStr(false))
|
||||
sb.Write(`(SELECT MAX(LENGTH(data)) FROM `+dialect.Quote("dashboard")+` WHERE is_folder = ?) AS dashboard_bytes_max,`, dialect.BooleanStr(false))
|
||||
sb.Write(`(SELECT COUNT(id) FROM `+dialect.Quote("dashboard")+` WHERE is_folder = ?) AS folders,`, dialect.BooleanStr(true))
|
||||
|
||||
sb.Write(`(
|
||||
|
||||
Reference in New Issue
Block a user