debian-mirror-gitlab/lib/gitlab/metrics/environment.rb
2023-04-23 21:23:45 +05:30

28 lines
476 B
Ruby

# frozen_string_literal: true
module Gitlab
module Metrics
module Environment
class << self
def web?
service?('web')
end
def api?
service?('api')
end
def git?
service?('git')
end
def service?(name)
env_var = ENV.fetch('GITLAB_METRICS_INITIALIZE', '')
return true unless env_var.present?
env_var == name
end
end
end
end
end