gitlab-org--gitlab-foss/app/controllers/concerns/with_performance_bar.rb
Sean McGivern 18cdc5ba6c Remove line profiler from performance bar
1. The output isn't great. It can be hard to find hotspots and, even
   when you do find them, to find why those are hotspots.
2. It uses some jQuery-specific frontend code which we can remove now
   that we don't have this any more.
3. It's only possible to profile the initial request, not any subsequent
   AJAX requests.
2019-07-30 10:00:52 +01:00

21 lines
488 B
Ruby

# frozen_string_literal: true
module WithPerformanceBar
extend ActiveSupport::Concern
def peek_enabled?
return false unless Gitlab::PerformanceBar.enabled?(current_user)
Gitlab::SafeRequestStore.fetch(:peek_enabled) { cookie_or_default_value }
end
private
def cookie_or_default_value
if cookies[:perf_bar_enabled].present?
cookies[:perf_bar_enabled] == 'true'
else
cookies[:perf_bar_enabled] = 'true' if Rails.env.development?
end
end
end