Module: Gitlab::Marginalia

Defined in:
lib/gitlab/marginalia.rb,
lib/gitlab/marginalia/comment.rb,
lib/gitlab/marginalia/active_record_instrumentation.rb

Defined Under Namespace

Modules: ActiveRecordInstrumentation, Comment

Constant Summary collapse

MARGINALIA_FEATURE_FLAG =
:marginalia

Class Method Summary collapse

Class Method Details

.cached_feature_enabled?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'lib/gitlab/marginalia.rb', line 19

def self.cached_feature_enabled?
  enabled
end

.enable_sidekiq_instrumentationObject


13
14
15
16
17
# File 'lib/gitlab/marginalia.rb', line 13

def self.enable_sidekiq_instrumentation
  if Sidekiq.server?
    ::Marginalia::SidekiqInstrumentation.enable!
  end
end

.set_application_nameObject


9
10
11
# File 'lib/gitlab/marginalia.rb', line 9

def self.set_application_name
  ::Marginalia.application_name = Gitlab.process_name
end

.set_feature_cacheObject


23
24
25
26
27
28
# File 'lib/gitlab/marginalia.rb', line 23

def self.set_feature_cache
  # During db:create and db:bootstrap skip feature query as DB is not available yet.
  return false unless Gitlab::Database.cached_table_exists?('features')

  self.enabled = Feature.enabled?(MARGINALIA_FEATURE_FLAG)
end