gitlab-org--gitlab-foss/app/controllers/concerns/with_performance_bar.rb
Rémy Coutable cdc1179fac Improve feature flag check for the performance bar
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-06 11:18:26 +02:00

17 lines
402 B
Ruby

module WithPerformanceBar
extend ActiveSupport::Concern
included do
include Peek::Rblineprof::CustomControllerHelpers
end
def peek_enabled?
return false unless Gitlab::PerformanceBar.enabled?(current_user)
if RequestStore.active?
RequestStore.fetch(:peek_enabled) { cookies[:perf_bar_enabled].present? }
else
cookies[:perf_bar_enabled].present?
end
end
end