1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-01 11:09:30 +02:00

More metrics

This commit is contained in:
binwiederhier 2023-03-16 22:19:20 -04:00
parent 358b344916
commit ca9fed7b67
5 changed files with 60 additions and 19 deletions
server

View file

@ -618,6 +618,7 @@ func (s *Server) handleMatrixDiscovery(w http.ResponseWriter) error {
}
func (s *Server) handlePublishInternal(r *http.Request, v *visitor) (*message, error) {
start := time.Now()
t, err := fromContext[*topic](r, contextTopic)
if err != nil {
return nil, err
@ -707,6 +708,7 @@ func (s *Server) handlePublishInternal(r *http.Request, v *visitor) (*message, e
if unifiedpush {
minc(metricUnifiedPushPublishedSuccess)
}
mset(metricMessagePublishDurationMillis, time.Since(start).Milliseconds())
return m, nil
}