Commit ee973a97 by bergquist

stats: send amount of stars as stats

parent ea988a37
......@@ -379,6 +379,7 @@ func sendUsageStats() {
metrics["stats.alerts.count"] = statsQuery.Result.Alerts
metrics["stats.active_users.count"] = statsQuery.Result.ActiveUsers
metrics["stats.datasources.count"] = statsQuery.Result.Datasources
metrics["stats.stars.count"] = statsQuery.Result.Stars
dsStats := models.GetDataSourceStatsQuery{}
if err := bus.Dispatch(&dsStats); err != nil {
......
......@@ -8,6 +8,7 @@ type SystemStats struct {
Orgs int64
Playlists int64
Alerts int64
Stars int64
}
type DataSourceStats struct {
......
......@@ -45,6 +45,9 @@ func GetSystemStats(query *m.GetSystemStatsQuery) error {
FROM ` + dialect.Quote("data_source") + `
) AS datasources,
(
SELECT COUNT(*) FROM ` + dialect.Quote("star") + `
) AS stars,
(
SELECT COUNT(*)
FROM ` + dialect.Quote("playlist") + `
) AS playlists,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment