diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-14 00:11:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-14 00:11:25 +0300 |
commit | 5f36333180258e43c88b71047086150b6ca233a4 (patch) | |
tree | 62b80c1edc934309aca3f3eddde766a1c6d94c4f /app/assets/javascripts/performance_bar | |
parent | a5605d87fb839e0b1015ad9e736c44fbb2ada202 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/performance_bar')
-rw-r--r-- | app/assets/javascripts/performance_bar/stores/performance_bar_store.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/performance_bar/stores/performance_bar_store.js b/app/assets/javascripts/performance_bar/stores/performance_bar_store.js index 9d12d228d35..51a8eb5ca69 100644 --- a/app/assets/javascripts/performance_bar/stores/performance_bar_store.js +++ b/app/assets/javascripts/performance_bar/stores/performance_bar_store.js @@ -47,10 +47,15 @@ export default class PerformanceBarStore { } canTrackRequest(requestUrl) { - return ( - requestUrl.endsWith('/api/graphql') || - this.requests.filter((request) => request.url === requestUrl).length < 2 - ); + // We want to store at most 2 unique requests per URL, as additional + // requests to the same URL probably aren't very interesting. + // + // GraphQL requests are the exception: because all GraphQL requests + // go to the same URL, we set a higher limit of 10 to allow + // capturing different queries a page may make. + const requestsLimit = requestUrl.endsWith('/api/graphql') ? 10 : 2; + + return this.requests.filter((request) => request.url === requestUrl).length < requestsLimit; } static truncateUrl(requestUrl) { |