Class: Bigcommerce::Prometheus::Integrations::Puma
- Inherits:
-
Object
- Object
- Bigcommerce::Prometheus::Integrations::Puma
- Defined in:
- lib/bigcommerce/prometheus/integrations/puma.rb
Overview
Plugin for puma
Class Method Summary collapse
- .active_record_enabled? ⇒ Boolean
-
.start ⇒ Object
Start the puma collector.
Class Method Details
.active_record_enabled? ⇒ Boolean
49 50 51 |
# File 'lib/bigcommerce/prometheus/integrations/puma.rb', line 49 def self.active_record_enabled? defined?(ActiveRecord) && ::ActiveRecord::Base.connection_pool.respond_to?(:stat) end |
.start ⇒ Object
Start the puma collector
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bigcommerce/prometheus/integrations/puma.rb', line 28 def self.start ::PrometheusExporter::Instrumentation::Puma.start( client: ::Bigcommerce::Prometheus.client, frequency: ::Bigcommerce::Prometheus.puma_collection_frequency ) if active_record_enabled? ::PrometheusExporter::Instrumentation::ActiveRecord.start( client: ::Bigcommerce::Prometheus.client, frequency: ::Bigcommerce::Prometheus.puma_collection_frequency ) end ::PrometheusExporter::Instrumentation::Process.start( client: ::Bigcommerce::Prometheus.client, type: ::Bigcommerce::Prometheus.puma_process_label, frequency: ::Bigcommerce::Prometheus.puma_collection_frequency ) end |