diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-27 12:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-27 12:09:46 +0300 |
commit | 018e39a9507cc12bee5c6a168641d9843c5a6419 (patch) | |
tree | bec953ed5a862b692c8c0d58c5088458f0fa6c8a /app/assets/javascripts/blob | |
parent | f3197dab7ff4b138d756290e9edcc4d829a6eb6e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/components/blob_content.vue | 1 | ||||
-rw-r--r-- | app/assets/javascripts/blob/viewer/index.js | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/components/blob_content.vue b/app/assets/javascripts/blob/components/blob_content.vue index f5f06436bcc..60729c11002 100644 --- a/app/assets/javascripts/blob/components/blob_content.vue +++ b/app/assets/javascripts/blob/components/blob_content.vue @@ -6,6 +6,7 @@ import BlobContentError from './blob_content_error.vue'; import { BLOB_RENDER_EVENT_LOAD, BLOB_RENDER_EVENT_SHOW_SOURCE } from './constants'; export default { + name: 'BlobContent', components: { GlLoadingIcon, BlobContentError, diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js index 4741152afce..22c6b31143f 100644 --- a/app/assets/javascripts/blob/viewer/index.js +++ b/app/assets/javascripts/blob/viewer/index.js @@ -1,6 +1,12 @@ import $ from 'jquery'; import '~/behaviors/markdown/render_gfm'; import { __ } from '~/locale'; +import { + REPO_BLOB_LOAD_VIEWER_START, + REPO_BLOB_LOAD_VIEWER_FINISH, + REPO_BLOB_LOAD_VIEWER, +} from '~/performance/constants'; +import { performanceMarkAndMeasure } from '~/performance/utils'; import { fixTitle } from '~/tooltips'; import { deprecatedCreateFlash as Flash } from '../../flash'; import axios from '../../lib/utils/axios_utils'; @@ -130,6 +136,9 @@ export default class BlobViewer { } switchToViewer(name) { + performanceMarkAndMeasure({ + mark: REPO_BLOB_LOAD_VIEWER_START, + }); const newViewer = this.$fileHolder[0].querySelector(`.blob-viewer[data-type='${name}']`); if (this.activeViewer === newViewer) return; @@ -163,6 +172,15 @@ export default class BlobViewer { handleLocationHash(); this.toggleCopyButtonState(); + performanceMarkAndMeasure({ + mark: REPO_BLOB_LOAD_VIEWER_FINISH, + measures: [ + { + name: REPO_BLOB_LOAD_VIEWER, + start: REPO_BLOB_LOAD_VIEWER_START, + }, + ], + }); }) .catch(() => new Flash(__('Error loading viewer'))); } |