Class: Gitlab::Metrics::Exporter::BaseExporter
- Defined in:
- lib/gitlab/metrics/exporter/base_exporter.rb
Direct Known Subclasses
Constant Summary collapse
- CERT_REGEX =
/-----BEGIN CERTIFICATE-----(?:.|\n)+?-----END CERTIFICATE-----/
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Attributes inherited from Daemon
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(settings, log_enabled:, log_file:, gc_requests: false, **options) ⇒ BaseExporter
constructor
A new instance of BaseExporter.
Methods inherited from Daemon
initialize_instance, instance, #start, #stop, #thread?, #thread_name
Constructor Details
#initialize(settings, log_enabled:, log_file:, gc_requests: false, **options) ⇒ BaseExporter
Returns a new instance of BaseExporter.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gitlab/metrics/exporter/base_exporter.rb', line 18 def initialize(settings, log_enabled:, log_file:, gc_requests: false, **) super(**) @settings = settings @gc_requests = gc_requests # log_enabled does not exist for all exporters log_sink = log_enabled ? File.join(Rails.root, 'log', log_file) : File::NULL @logger = WEBrick::Log.new(log_sink) @logger.time_format = "[%Y-%m-%dT%H:%M:%S.%L%z]" end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
12 13 14 |
# File 'lib/gitlab/metrics/exporter/base_exporter.rb', line 12 def server @server end |
Instance Method Details
#enabled? ⇒ Boolean
30 31 32 |
# File 'lib/gitlab/metrics/exporter/base_exporter.rb', line 30 def enabled? settings.enabled end |