1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-09 14:34:36 +02:00

Allow /metrics on default port; reduce memory if not enabled

This commit is contained in:
binwiederhier 2023-03-15 22:34:06 -04:00
parent bb3fe4f830
commit 358b344916
9 changed files with 184 additions and 125 deletions

View file

@ -83,12 +83,10 @@ func (s *Server) execManager() {
"emails_sent_failure": sentMailFailure,
}).
Info("Server stats")
if s.httpMetricsServer != nil {
metrics.messagesCached.Set(float64(messagesCached))
metrics.visitors.Set(float64(visitorsCount))
metrics.subscribers.Set(float64(subscribers))
metrics.topics.Set(float64(topicsCount))
}
mset(metricMessagesCached, messagesCached)
mset(metricVisitors, visitorsCount)
mset(metricSubscribers, subscribers)
mset(metricTopics, topicsCount)
}
func (s *Server) pruneVisitors() {