Commit ee973a97 by bergquist

stats: send amount of stars as stats

parent ea988a37
...@@ -379,6 +379,7 @@ func sendUsageStats() { ...@@ -379,6 +379,7 @@ func sendUsageStats() {
metrics["stats.alerts.count"] = statsQuery.Result.Alerts metrics["stats.alerts.count"] = statsQuery.Result.Alerts
metrics["stats.active_users.count"] = statsQuery.Result.ActiveUsers metrics["stats.active_users.count"] = statsQuery.Result.ActiveUsers
metrics["stats.datasources.count"] = statsQuery.Result.Datasources metrics["stats.datasources.count"] = statsQuery.Result.Datasources
metrics["stats.stars.count"] = statsQuery.Result.Stars
dsStats := models.GetDataSourceStatsQuery{} dsStats := models.GetDataSourceStatsQuery{}
if err := bus.Dispatch(&dsStats); err != nil { if err := bus.Dispatch(&dsStats); err != nil {
......
...@@ -8,6 +8,7 @@ type SystemStats struct { ...@@ -8,6 +8,7 @@ type SystemStats struct {
Orgs int64 Orgs int64
Playlists int64 Playlists int64
Alerts int64 Alerts int64
Stars int64
} }
type DataSourceStats struct { type DataSourceStats struct {
......
...@@ -45,6 +45,9 @@ func GetSystemStats(query *m.GetSystemStatsQuery) error { ...@@ -45,6 +45,9 @@ func GetSystemStats(query *m.GetSystemStatsQuery) error {
FROM ` + dialect.Quote("data_source") + ` FROM ` + dialect.Quote("data_source") + `
) AS datasources, ) AS datasources,
( (
SELECT COUNT(*) FROM ` + dialect.Quote("star") + `
) AS stars,
(
SELECT COUNT(*) SELECT COUNT(*)
FROM ` + dialect.Quote("playlist") + ` FROM ` + dialect.Quote("playlist") + `
) AS playlists, ) 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