Add metrics for mobile versions snapshots (#28191)

* Add metrics for mobile versions snapshots

* Add notifications disabled and fix lint

* Address feedback

* Verify all references to JobTypeActiveUsers

* Fix typos

* Improve platform values

* Add test and MySQL support
Этот коммит содержится в:
Daniel Espino García
2024-09-24 12:02:19 +02:00
коммит произвёл GitHub
родитель d45a54a8e9
Коммит 040838b056
17 изменённых файлов: 489 добавлений и 0 удалений

Просмотреть файл

@@ -7849,6 +7849,22 @@ func (s *TimerLayerSessionStore) GetLRUSessions(c request.CTX, userID string, li
return result, err
}
func (s *TimerLayerSessionStore) GetMobileSessionMetadata() ([]*model.MobileSessionMetadata, error) {
start := time.Now()
result, err := s.SessionStore.GetMobileSessionMetadata()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetMobileSessionMetadata", success, elapsed)
}
return result, err
}
func (s *TimerLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
start := time.Now()