debian-mirror-gitlab/lib/gitlab/cluster/puma_worker_killer_observer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
491 B
Ruby
Raw Permalink Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
module Gitlab
module Cluster
class PumaWorkerKillerObserver
def initialize
@counter = Gitlab::Metrics.counter(:puma_killer_terminations_total, 'Number of workers terminated by PumaWorkerKiller')
end
# returns the Proc to be used as the observer callback block
def callback
method(:log_termination)
end
private
def log_termination(worker)
2019-10-12 21:52:04 +05:30
@counter.increment
2019-09-04 21:01:54 +05:30
end
end
end
end