1---
2stage: Monitor
3group: Monitor
4info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
5---
6
7# Performance bar **(FREE SELF)**
8
9> - The **Stats** field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/271551) in GitLab 13.9.
10> - The **Memory** field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/330736) in GitLab 14.0.
11> - The **Flamegraph** field [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/30275) in GitLab 14.4.
12
13You can display the performance bar to see statistics for the performance of a GitLab UI page.
14For example:
15
16![Performance bar](img/performance_bar_v14_4.png)
17
18## Available information
19
20From left to right, the performance bar displays:
21
22- **Current Host**: the current host serving the page.
23- **Database queries**: the time taken (in milliseconds) and the total number
24  of database queries, displayed in the format `00ms / 00 (00 cached) pg`. Click to display
25  a modal window with more details. You can use this to see the following
26  details for each query:
27  - **In a transaction**: shows up below the query if it was executed in
28    the context of a transaction
29  - **Role**: shows up when [Database Load Balancing](../../postgresql/database_load_balancing.md)
30    is enabled. It shows which server role was used for the query.
31    "Primary" means that the query was sent to the read/write primary server.
32    "Replica" means it was sent to a read-only replica.
33  - **Config name**: shows up only when the
34    `GITLAB_MULTIPLE_DATABASE_METRICS` environment variable is set. This is
35    used to distinguish between different databases configured for different
36    GitLab features. The name shown is the same name used to configure database
37    connections in GitLab.
38- **Gitaly calls**: the time taken (in milliseconds) and the total number of
39  [Gitaly](../../gitaly/index.md) calls. Click to display a modal window with more
40  details.
41- **Rugged calls**: the time taken (in milliseconds) and the total number of
42  [Rugged](../../nfs.md#improving-nfs-performance-with-gitlab) calls.
43  Click to display a modal window with more details.
44- **Redis calls**: the time taken (in milliseconds) and the total number of
45  Redis calls. Click to display a modal window with more details.
46- **Elasticsearch calls**: the time taken (in milliseconds) and the total number of
47  Elasticsearch calls. Click to display a modal window with more details.
48- **External HTTP calls**: the time taken (in milliseconds) and the total
49  number of external calls to other systems. Click to display a modal window
50  with more details.
51- **Load timings** of the page: if your browser supports load timings (Chromium
52  and Chrome) several values in milliseconds, separated by slashes.
53  Click to display a modal window with more details. The values, from left to right:
54  - **Backend**: time needed for the base page to load.
55  - [**First Contentful Paint**](https://web.dev/first-contentful-paint/):
56    Time until something was visible to the user.
57  - [**DomContentLoaded**](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp) Event.
58  - **Total number of requests** the page loaded.
59- **Memory**: the amount of memory consumed and objects allocated during the selected request.
60  Select it to display a window with more details.
61- **Trace**: if Jaeger is integrated, **Trace** links to a Jaeger tracing page
62  with the current request's `correlation_id` included.
63- **+**: a link to add a request's details to the performance bar. The request
64  can be added by its full URL (authenticated as the current user), or by the value of
65  its `X-Request-Id` header.
66- **Download**: a link to download the raw JSON used to generate the Performance Bar reports.
67- **Flamegraph** with mode: a link to generate a [flamegraph](../../../development/profiling.md#speedscope-flamegraphs)
68  of the current URL with the selected [Stackprof mode](https://github.com/tmm1/stackprof#sampling):
69  - The **Wall** mode samples every *interval* of the time on a clock on a wall. The interval is set to `10100` microseconds.
70  - The **CPU** mode samples every *interval* of CPU activity. The interval is set to `10100` microseconds.
71  - The **Object** mode samples every *interval*. The interval is set to `100` allocations.
72- **Request Selector**: a select box displayed on the right-hand side of the
73  Performance Bar which enables you to view these metrics for any requests made while
74  the current page was open. Only the first two requests per unique URL are captured.
75- **Stats** (optional): if the `GITLAB_PERFORMANCE_BAR_STATS_URL` environment variable is set,
76  this URL is displayed in the bar. In GitLab 13.9 and later, used only in GitLab SaaS.
77
78NOTE:
79Not all indicators are available in all environments. For instance, the memory view
80requires running Ruby with [specific patches](https://gitlab.com/gitlab-org/gitlab-build-images/-/blob/master/patches/ruby/2.7.4/thread-memory-allocations-2.7.patch)
81applied. When running GitLab locally using [GDK](../../../development/contributing/index.md#gitlab-development-kit),
82this is typically not the case and the memory view cannot be used.
83
84## Keyboard shortcut
85
86Press the [<kbd>p</kbd> + <kbd>b</kbd> keyboard shortcut](../../../user/shortcuts.md) to display
87the performance bar, and again to hide it.
88
89For non-administrators to display the performance bar, it must be
90[enabled for them](#enable-the-performance-bar-for-non-administrators).
91
92## Request warnings
93
94Requests that exceed predefined limits display a warning **{warning}** icon and
95explanation next to the metric. In this example, the Gitaly call duration
96exceeded the threshold.
97
98![Gitaly call duration exceeded threshold](img/performance_bar_gitaly_threshold.png)
99
100If any requests on the current page generated warnings, the warning icon displays
101next to the **Requests** selector menu. In this selector menu, an exclamation `(!)`
102appears next to requests with warnings.
103
104![Request selector showing two requests with warnings](img/performance_bar_request_selector_warning.png)
105
106## Enable the performance bar for non-administrators
107
108The performance bar is disabled by default for non-administrators. To enable it
109for a given group:
110
1111. Sign in as a user with Administrator [role](../../../user/permissions.md).
1121. On the top bar, select **Menu > Admin**.
1131. On the left sidebar, select **Settings > Metrics and profiling**
114   (`admin/application_settings/metrics_and_profiling`), and expand
115   **Profiling - Performance bar**.
1161. Click **Allow non-administrators access to the performance bar**.
1171. In the **Allow access to members of the following group** field, provide the full path of the
118   group allowed to access the performance.
1191. Click **Save changes**.
120