1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

Add database stats to Prometheus exporter

This commit is contained in:
Frédéric Guillot 2021-05-22 20:27:13 -07:00 committed by fguillot
parent 012eb61c52
commit 36d3b1e9fb
2 changed files with 78 additions and 2 deletions

View file

@ -31,6 +31,10 @@ func (s *Storage) DatabaseVersion() string {
// Ping checks if the database connection works.
func (s *Storage) Ping() error {
_, err := s.db.Exec(`SELECT true`)
return err
return s.db.Ping()
}
// DBStats returns database statistics.
func (s *Storage) DBStats() sql.DBStats {
return s.db.Stats()
}