Class: Gitlab::Email::Hook::DeliveryMetricsObserver

Inherits:
Object
  • Object
show all
Extended by:
Utils::StrongMemoize
Defined in:
lib/gitlab/email/hook/delivery_metrics_observer.rb

Class Method Summary collapse

Methods included from Utils::StrongMemoize

clear_memoization, strong_memoize, strong_memoized?

Class Method Details

.delivered_email(_message) ⇒ Object


13
14
15
# File 'lib/gitlab/email/hook/delivery_metrics_observer.rb', line 13

def self.delivered_email(_message)
  delivered_emails_counter.increment
end

.delivered_emails_counterObject


24
25
26
27
28
29
# File 'lib/gitlab/email/hook/delivery_metrics_observer.rb', line 24

def self.delivered_emails_counter
  strong_memoize(:delivered_emails_counter) do
    Gitlab::Metrics.counter(:gitlab_emails_delivered_total,
                            'Counter of total emails delievered')
  end
end

.delivering_email(_message) ⇒ Object


9
10
11
# File 'lib/gitlab/email/hook/delivery_metrics_observer.rb', line 9

def self.delivering_email(_message)
  delivery_attempts_counter.increment
end

.delivery_attempts_counterObject


17
18
19
20
21
22
# File 'lib/gitlab/email/hook/delivery_metrics_observer.rb', line 17

def self.delivery_attempts_counter
  strong_memoize(:delivery_attempts_counter) do
    Gitlab::Metrics.counter(:gitlab_emails_delivery_attempts_total,
                            'Counter of total emails delivery attempts')
  end
end