Этот коммит содержится в:
Conor Macpherson
2022-12-08 16:20:17 -05:00
родитель c0735ae689
Коммит 68c27f7c37
3 изменённых файлов: 110 добавлений и 0 удалений

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

@@ -11224,6 +11224,22 @@ func (s *TimerLayerWebhookStore) GetIncomingListByUser(userID string, offset int
return result, err
}
func (s *TimerLayerWebhookStore) GetIncomingTotal() (int64, error) {
start := time.Now()
result, err := s.WebhookStore.GetIncomingTotal()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingTotal", success, elapsed)
}
return result, err
}
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
start := time.Now()
@@ -11336,6 +11352,22 @@ func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userID string, offset int
return result, err
}
func (s *TimerLayerWebhookStore) GetOutgoingTotal() (int64, error) {
start := time.Now()
result, err := s.WebhookStore.GetOutgoingTotal()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingTotal", success, elapsed)
}
return result, err
}
func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) {
start := time.Now()