Skip to content

Commit

Permalink
fix: add track count to /debug/vars metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Oct 17, 2023
1 parent 9818523 commit 69c02e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/gonic/gonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 69c02e8

Please sign in to comment.