Class: Gitlab::Metrics::Samplers::PumaSampler
- Inherits:
-
BaseSampler
- Object
- Daemon
- BaseSampler
- Gitlab::Metrics::Samplers::PumaSampler
- Defined in:
- lib/gitlab/metrics/samplers/puma_sampler.rb
Constant Summary collapse
- DEFAULT_SAMPLING_INTERVAL_SECONDS =
5
Instance Attribute Summary
Attributes inherited from BaseSampler
Attributes inherited from Daemon
Instance Method Summary collapse
Methods inherited from BaseSampler
#initialize, #safe_sample, #sleep_interval
Methods inherited from Daemon
#enabled?, #initialize, initialize_instance, instance, #start, #stop, #thread?, #thread_name
Constructor Details
This class inherits a constructor from Gitlab::Metrics::Samplers::BaseSampler
Instance Method Details
#init_metrics ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gitlab/metrics/samplers/puma_sampler.rb', line 13 def init_metrics { puma_workers: ::Gitlab::Metrics.gauge(:puma_workers, 'Total number of workers'), puma_running_workers: ::Gitlab::Metrics.gauge(:puma_running_workers, 'Number of active workers'), puma_stale_workers: ::Gitlab::Metrics.gauge(:puma_stale_workers, 'Number of stale workers'), puma_running: ::Gitlab::Metrics.gauge(:puma_running, 'Number of running threads'), puma_queued_connections: ::Gitlab::Metrics.gauge(:puma_queued_connections, 'Number of connections in that worker\'s "todo" set waiting for a worker thread'), puma_active_connections: ::Gitlab::Metrics.gauge(:puma_active_connections, 'Number of threads processing a request'), puma_pool_capacity: ::Gitlab::Metrics.gauge(:puma_pool_capacity, 'Number of requests the worker is capable of taking right now'), puma_max_threads: ::Gitlab::Metrics.gauge(:puma_max_threads, 'Maximum number of worker threads'), puma_idle_threads: ::Gitlab::Metrics.gauge(:puma_idle_threads, 'Number of spawned threads which are not processing a request') } end |
#metrics ⇒ Object
9 10 11 |
# File 'lib/gitlab/metrics/samplers/puma_sampler.rb', line 9 def metrics @metrics ||= init_metrics end |