summaryrefslogtreecommitdiff
path: root/lib/gitlab/performance_bar
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-281-1/+1
|
* Merge branch 'fix-peek-on-puma' into 'master'Rémy Coutable2019-09-021-2/+2
|\ | | | | | | | | | | | | Fix Peek on Puma Closes #66528 See merge request gitlab-org/gitlab-ce!32213
| * Make performance bar enabled checks consistentSean McGivern2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | 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).
* | Add top-level warnings key to performance bar responseperformance-bar-warningsSean McGivern2019-08-281-0/+19
|/ | | | | | This key is useful to reduce the amount of logic needed on the frontend: if `has_warnings` is true, then the frontend knows that the request in question has warnings for some metric.
* Replace peek-pg with our own implementationremove-peek-pgSean McGivern2019-07-261-45/+0
| | | | | | | | | | This uses an ActiveRecord subscriber to get queries and calculate the total query time from that. This means that the total will always be consistent with the queries in the table. It does however mean that we could potentially miss some queries that don't go through ActiveRecord. Making this change also allows us to unify the response JSON a little bit, making the frontend slightly simpler as a result.
* Only save Peek session in Redis when Peek is enabledRémy Coutable2019-07-031-0/+12
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add backtraces to Peek performance bar for SQL callssh-add-backtrace-to-sql-queriesStan Hu2019-06-091-3/+4
| | | | | | | Just as we have backtraces for Gitaly, we should also have backtraces for SQL calls. This makes it much easier to find the source of the SQL call and optimize N+1 queries and other performance issues with an endpoint.
* Upgrade Rails to 5.1.6.1Jasper Maes2019-04-231-5/+1
| | | | Model.new.attributes now also returns encrypted attributes.
* Enable even more frozen string for lib/gitlabgfyoung2018-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Enables frozen string for the following: * lib/gitlab/patch/**/*.rb * lib/gitlab/popen/**/*.rb * lib/gitlab/profiler/**/*.rb * lib/gitlab/project_authorizations/**/*.rb * lib/gitlab/prometheus/**/*.rb * lib/gitlab/query_limiting/**/*.rb * lib/gitlab/quick_actions/**/*.rb * lib/gitlab/redis/**/*.rb * lib/gitlab/request_profiler/**/*.rb * lib/gitlab/search/**/*.rb * lib/gitlab/sherlock/**/*.rb * lib/gitlab/sidekiq_middleware/**/*.rb * lib/gitlab/slash_commands/**/*.rb * lib/gitlab/sql/**/*.rb * lib/gitlab/template/**/*.rb * lib/gitlab/testing/**/*.rb * lib/gitlab/utils/**/*.rb * lib/gitlab/webpack/**/*.rb Partially addresses gitlab-org/gitlab-ce#47424.
* Simplify by using Gitlab::SafeRequestStoreMichael Kozono2018-09-241-1/+1
| | | | These are clear wins.
* Fix SQL timings for the performance barYorick Peterse2017-11-031-1/+1
| | | | | My recent change accidentally changed the reported time from milliseconds to seconds, resulting in wrong timings being displayed.
* Remove Sherlock usage from the performance barperformance-bar-sqlYorick Peterse2017-10-231-2/+2
| | | | | | | | | | Sherlock::Query generates a backtrace on every call to "new", which is very slow. Formatter queries are also not displayed properly due to the lack of "white-space: pre" in the CSS. We took a look at fixing this, but the produced output is not really better than just displaying queries on one line. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/39351
* Merge branch 'rc/bump-peek-performance_bar' into 'master'Sean McGivern2017-07-191-22/+0
|\ | | | | | | | | Bump peek-performance_bar to 1.3.0 and get rid of a monkey-patch See merge request !12939
| * Bump peek-performance_bar to 1.3.0 and get rid of a monkey-patchrc/bump-peek-performance_barRémy Coutable2017-07-181-22/+0
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Fix queries duration sorting in Performance Bar35252-fix-performance-bar-queries-duration-sortingRémy Coutable2017-07-181-1/+1
|/ | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Don't track cached queries in Gitlab::PerformanceBar::PeekQueryTracker34940-peek-performance-bar-doesn-t-count-cached-queries-but-shows-themRémy Coutable2017-07-171-1/+8
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Ensure peek-performance_bar doesn't break existing functionalitiesRémy Coutable2017-06-091-0/+22
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix Rubocop offenses, improve SQL duration format and changelog entryRémy Coutable2017-06-091-1/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Display queries duration in performance bar queries modalRémy Coutable2017-06-092-42/+8
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Store Sherlock::Query in Peek adapterRémy Coutable2017-06-092-0/+72
Signed-off-by: Rémy Coutable <remy@rymai.me>