summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/with_performance_bar.rb
Commit message (Collapse)AuthorAgeFilesLines
* Make performance bar enabled checks consistentSean McGivern2019-08-281-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | Previously, we called the `peek_enabled?` method like so: prepend_before_action :set_peek_request_id, if: :peek_enabled? Now we don't have a `set_peek_request_id` method, so we don't need that line. However, the `peek_enabled?` part had a side-effect: it would also populate the request store cache for whether the performance bar was enabled for the current request or not. This commit makes that side-effect explicit, and replaces all uses of `peek_enabled?` with the more explicit `Gitlab::PerformanceBar.enabled_for_request?`. There is one spec that still sets `SafeRequestStore[:peek_enabled]` directly, because it is contrasting behaviour with and without a request store enabled. The upshot is: 1. We still set the value in one place. We make it more explicit that that's what we're doing. 2. Reading that value uses a consistent method so it's easier to find in future.
* Fix Peek on PumaSean McGivern2019-08-271-0/+6
| | | | | | | | | | Peek's `Peek.request_id` method doesn't work well with a multi-threaded server and concurrent requests, because requests can 'steal' another request's ID, or unset it before it was due. The upstream change resolves this; the commit here is just to ensure that GitLab works with that upstream change, mostly by not using `Peek.request_id` any more (as the method doesn't exist).
* Remove line profiler from performance barSean McGivern2019-07-301-4/+0
| | | | | | | | | 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.
* Simplify by using Gitlab::SafeRequestStoreMichael Kozono2018-09-241-5/+1
| | | | These are clear wins.
* Enable frozen string in app/controllers/**/*.rbrepo-forks/gitlab-ce-frozen-string-app-controllergfyoung2018-09-181-0/+2
| | | | | | | | | | | | Enables frozen string for the following: * app/controllers/*.rb * app/controllers/admin/**/*.rb * app/controllers/boards/**/*.rb * app/controllers/ci/**/*.rb * app/controllers/concerns/**/*.rb Partially addresses #47424.
* In development, allow the toggling of the performance barRémy Coutable2018-01-171-3/+12
| | | | | | The performance bar is still displayed by default in development. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Enable the performance bar in dev environmentsZeger-Jan van de Weg2017-12-131-0/+1
|
* Improve feature flag check for the performance barRémy Coutable2017-07-061-2/+0
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Hide 'peek' by using 'performance bar' insteadRémy Coutable2017-07-061-0/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Allow to enable the performance bar per user or Flipper groupRémy Coutable2017-07-061-0/+17
A `performance_team` Flipper group has been created. By default this group is nil but this can be customized in `gitlab.yml` via the performance_bar.allowed_group setting. Signed-off-by: Rémy Coutable <remy@rymai.me>