From 69c02e8352c10276697184d3c24d0f3253ec8c4d Mon Sep 17 00:00:00 2001 From: sentriz Date: Tue, 17 Oct 2023 19:15:20 +0100 Subject: [PATCH] fix: add track count to /debug/vars metrics endpoint fixes #392 --- cmd/gonic/gonic.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/gonic/gonic.go b/cmd/gonic/gonic.go index 20ac367f..f81b732d 100644 --- a/cmd/gonic/gonic.go +++ b/cmd/gonic/gonic.go @@ -267,6 +267,7 @@ func main() { mux.Handle("/debug/vars", expvar.Handler()) expvar.Publish("stats", expvar.Func(func() any { var stats struct{ Albums, Tracks, Artists, InternetRadioStations, Podcasts uint } + dbc.Model(db.Track{}).Count(&stats.Tracks) dbc.Model(db.Album{}).Count(&stats.Albums) dbc.Model(db.Artist{}).Count(&stats.Artists) dbc.Model(db.InternetRadioStation{}).Count(&stats.InternetRadioStations)