Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-05-29 15:27:44 +0300
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-05-29 15:27:44 +0300
commita5adc6a024012f727ac32c440bb42f4634ae0605 (patch)
treec02e44b595f6bdc67bc647234dfc4a19972aba6b /lib/gitlab/cluster
parentd017d2d93d6afbd597cbf6683fcd7f90e88a05de (diff)
Add Puma sampler
This sampler gathers Puma-specific metrics which can be used by Prometheus then.
Diffstat (limited to 'lib/gitlab/cluster')
-rw-r--r--lib/gitlab/cluster/lifecycle_events.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/cluster/lifecycle_events.rb b/lib/gitlab/cluster/lifecycle_events.rb
index b05dca409d1..e0f9eb59924 100644
--- a/lib/gitlab/cluster/lifecycle_events.rb
+++ b/lib/gitlab/cluster/lifecycle_events.rb
@@ -44,6 +44,14 @@ module Gitlab
(@master_restart_hooks ||= []) << block
end
+ def on_master_start(&block)
+ if in_clustered_environment?
+ on_before_fork(&block)
+ else
+ on_worker_start(&block)
+ end
+ end
+
#
# Lifecycle integration methods (called from unicorn.rb, puma.rb, etc.)
#