Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
101a0140
Commit
101a0140
authored
Jul 29, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance measurement for Snippet Edit view
parent
fca4ba9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
app/assets/javascripts/blob/components/blob_edit_content.vue
app/assets/javascripts/blob/components/blob_edit_content.vue
+11
-0
app/assets/javascripts/performance_constants.js
app/assets/javascripts/performance_constants.js
+1
-0
app/assets/javascripts/snippets/components/edit.vue
app/assets/javascripts/snippets/components/edit.vue
+4
-0
No files found.
app/assets/javascripts/blob/components/blob_edit_content.vue
View file @
101a0140
<
script
>
<
script
>
import
{
initEditorLite
}
from
'
~/blob/utils
'
;
import
{
initEditorLite
}
from
'
~/blob/utils
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
SNIPPET_MARK_BLOB_CONTENT
,
SNIPPET_MARK_EDIT_APP_START
,
SNIPPET_MEASURE_BLOB_CONTENT
,
SNIPPET_MEASURE_BLOB_CONTENT_WITHIN_APP
,
}
from
'
~/performance_constants
'
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -31,6 +37,11 @@ export default {
...
@@ -31,6 +37,11 @@ export default {
blobPath
:
this
.
fileName
,
blobPath
:
this
.
fileName
,
blobContent
:
this
.
value
,
blobContent
:
this
.
value
,
});
});
window
.
requestAnimationFrame
(()
=>
{
performance
.
mark
(
SNIPPET_MARK_BLOB_CONTENT
);
performance
.
measure
(
SNIPPET_MEASURE_BLOB_CONTENT
);
performance
.
measure
(
SNIPPET_MEASURE_BLOB_CONTENT_WITHIN_APP
,
SNIPPET_MARK_EDIT_APP_START
);
});
},
},
methods
:
{
methods
:
{
triggerFileChange
:
debounce
(
function
debouncedFileChange
()
{
triggerFileChange
:
debounce
(
function
debouncedFileChange
()
{
...
...
app/assets/javascripts/performance_constants.js
View file @
101a0140
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// marks
// marks
export
const
SNIPPET_MARK_VIEW_APP_START
=
'
snippet-view-app-start
'
;
export
const
SNIPPET_MARK_VIEW_APP_START
=
'
snippet-view-app-start
'
;
export
const
SNIPPET_MARK_EDIT_APP_START
=
'
snippet-edit-app-start
'
;
export
const
SNIPPET_MARK_BLOB_CONTENT
=
'
snippet-blob-content-finished
'
;
export
const
SNIPPET_MARK_BLOB_CONTENT
=
'
snippet-blob-content-finished
'
;
// Measures
// Measures
...
...
app/assets/javascripts/snippets/components/edit.vue
View file @
101a0140
...
@@ -21,6 +21,7 @@ import {
...
@@ -21,6 +21,7 @@ import {
import
SnippetBlobEdit
from
'
./snippet_blob_edit.vue
'
;
import
SnippetBlobEdit
from
'
./snippet_blob_edit.vue
'
;
import
SnippetVisibilityEdit
from
'
./snippet_visibility_edit.vue
'
;
import
SnippetVisibilityEdit
from
'
./snippet_visibility_edit.vue
'
;
import
SnippetDescriptionEdit
from
'
./snippet_description_edit.vue
'
;
import
SnippetDescriptionEdit
from
'
./snippet_description_edit.vue
'
;
import
{
SNIPPET_MARK_EDIT_APP_START
}
from
'
~/performance_constants
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -106,6 +107,9 @@ export default {
...
@@ -106,6 +107,9 @@ export default {
return
`
${
this
.
isProjectSnippet
?
'
project
'
:
'
personal
'
}
_snippet_description`
;
return
`
${
this
.
isProjectSnippet
?
'
project
'
:
'
personal
'
}
_snippet_description`
;
},
},
},
},
beforeCreate
()
{
performance
.
mark
(
SNIPPET_MARK_EDIT_APP_START
);
},
created
()
{
created
()
{
window
.
addEventListener
(
'
beforeunload
'
,
this
.
onBeforeUnload
);
window
.
addEventListener
(
'
beforeunload
'
,
this
.
onBeforeUnload
);
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment