diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/assets/javascripts/blob/viewer/index.js | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/assets/javascripts/blob/viewer/index.js')
-rw-r--r-- | app/assets/javascripts/blob/viewer/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
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'))); } |