diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-05-29 15:27:44 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-05-29 15:27:44 +0300 |
commit | a5adc6a024012f727ac32c440bb42f4634ae0605 (patch) | |
tree | c02e44b595f6bdc67bc647234dfc4a19972aba6b /lib/gitlab/cluster | |
parent | d017d2d93d6afbd597cbf6683fcd7f90e88a05de (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.rb | 8 |
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.) # |