Commit graph

12 commits

Author SHA1 Message Date
GitLab Bot
b7ff336e24 Add latest changes from gitlab-org/gitlab@master 2021-06-01 06:09:35 +00:00
GitLab Bot
154523302b Add latest changes from gitlab-org/gitlab@master 2021-04-27 12:10:12 +00:00
Sean McGivern
f9c456bd0c Make performance bar enabled checks consistent
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.
2019-08-28 17:25:02 +01:00
Sean McGivern
7f102819a5 Fix Peek on Puma
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).
2019-08-27 14:15:25 +01:00
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
Michael Kozono
f107bc69e3 Simplify by using Gitlab::SafeRequestStore
These are clear wins.
2018-09-24 12:11:26 -07:00
gfyoung
73322a0e55 Enable frozen string in app/controllers/**/*.rb
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.
2018-09-18 21:22:45 -07:00
Rémy Coutable
28d39447c3 In development, allow the toggling of the performance bar
The performance bar is still displayed by default in development.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-01-17 13:56:05 +01:00
Zeger-Jan van de Weg
b6bd77f5dd
Enable the performance bar in dev environments 2017-12-13 15:14:58 +01:00
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
Rémy Coutable
19b8d8af2c Hide 'peek' by using 'performance bar' instead
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-06 11:18:25 +02:00
Rémy Coutable
186048a404 Allow to enable the performance bar per user or Flipper group
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>
2017-07-06 11:18:25 +02:00