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:
parent
012eb61c52
commit
36d3b1e9fb
2 changed files with 78 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue