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
cc8057b7
Commit
cc8057b7
authored
Oct 30, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add performance instrumentation helpers to MR Diffs App
parent
2f9ed98c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
app/assets/javascripts/diffs/constants.js
app/assets/javascripts/diffs/constants.js
+5
-0
app/assets/javascripts/diffs/utils/performance.js
app/assets/javascripts/diffs/utils/performance.js
+80
-0
app/assets/javascripts/performance/constants.js
app/assets/javascripts/performance/constants.js
+14
-0
No files found.
app/assets/javascripts/diffs/constants.js
View file @
cc8057b7
...
...
@@ -98,3 +98,8 @@ export const RENAMED_DIFF_TRANSITIONS = {
// MR Diffs known events
export
const
EVT_EXPAND_ALL_FILES
=
'
mr:diffs:expandAllFiles
'
;
export
const
EVT_PERF_MARK_FILE_TREE_START
=
'
mr:diffs:perf:fileTreeStart
'
;
export
const
EVT_PERF_MARK_FILE_TREE_END
=
'
mr:diffs:perf:fileTreeEnd
'
;
export
const
EVT_PERF_MARK_DIFF_FILES_START
=
'
mr:diffs:perf:filesStart
'
;
export
const
EVT_PERF_MARK_FIRST_DIFF_FILE_SHOWN
=
'
mr:diffs:perf:firstFileShown
'
;
export
const
EVT_PERF_MARK_DIFF_FILES_END
=
'
mr:diffs:perf:filesEnd
'
;
app/assets/javascripts/diffs/utils/performance.js
0 → 100644
View file @
cc8057b7
import
{
performanceMarkAndMeasure
}
from
'
~/performance_utils
'
;
import
{
MR_DIFFS_MARK_FILE_TREE_START
,
MR_DIFFS_MARK_FILE_TREE_END
,
MR_DIFFS_MARK_DIFF_FILES_START
,
MR_DIFFS_MARK_FIRST_DIFF_FILE_SHOWN
,
MR_DIFFS_MARK_DIFF_FILES_END
,
MR_DIFFS_MEASURE_FILE_TREE_DONE
,
MR_DIFFS_MEASURE_DIFF_FILES_DONE
,
}
from
'
../../performance_constants
'
;
import
eventHub
from
'
../event_hub
'
;
import
{
EVT_PERF_MARK_FILE_TREE_START
,
EVT_PERF_MARK_FILE_TREE_END
,
EVT_PERF_MARK_DIFF_FILES_START
,
EVT_PERF_MARK_FIRST_DIFF_FILE_SHOWN
,
EVT_PERF_MARK_DIFF_FILES_END
,
}
from
'
../constants
'
;
function
treeStart
()
{
performanceMarkAndMeasure
({
mark
:
MR_DIFFS_MARK_FILE_TREE_START
,
});
}
function
treeEnd
()
{
performanceMarkAndMeasure
({
mark
:
MR_DIFFS_MARK_FILE_TREE_END
,
measures
:
[
{
name
:
MR_DIFFS_MEASURE_FILE_TREE_DONE
,
start
:
MR_DIFFS_MARK_FILE_TREE_START
,
end
:
MR_DIFFS_MARK_FILE_TREE_END
,
},
],
});
}
function
filesStart
()
{
performanceMarkAndMeasure
({
mark
:
MR_DIFFS_MARK_DIFF_FILES_START
,
});
}
function
filesEnd
()
{
performanceMarkAndMeasure
({
mark
:
MR_DIFFS_MARK_DIFF_FILES_END
,
measures
:
[
{
name
:
MR_DIFFS_MEASURE_DIFF_FILES_DONE
,
start
:
MR_DIFFS_MARK_DIFF_FILES_START
,
end
:
MR_DIFFS_MARK_DIFF_FILES_END
,
},
],
});
}
function
firstFile
()
{
performanceMarkAndMeasure
({
mark
:
MR_DIFFS_MARK_FIRST_DIFF_FILE_SHOWN
,
});
}
export
const
diffsApp
=
{
instrument
()
{
eventHub
.
$on
(
EVT_PERF_MARK_FILE_TREE_START
,
treeStart
);
eventHub
.
$on
(
EVT_PERF_MARK_FILE_TREE_END
,
treeEnd
);
eventHub
.
$on
(
EVT_PERF_MARK_DIFF_FILES_START
,
filesStart
);
eventHub
.
$on
(
EVT_PERF_MARK_DIFF_FILES_END
,
filesEnd
);
eventHub
.
$on
(
EVT_PERF_MARK_FIRST_DIFF_FILE_SHOWN
,
firstFile
);
},
deinstrument
()
{
eventHub
.
$off
(
EVT_PERF_MARK_FIRST_DIFF_FILE_SHOWN
,
firstFile
);
eventHub
.
$off
(
EVT_PERF_MARK_DIFF_FILES_END
,
filesEnd
);
eventHub
.
$off
(
EVT_PERF_MARK_DIFF_FILES_START
,
filesStart
);
eventHub
.
$off
(
EVT_PERF_MARK_FILE_TREE_END
,
treeEnd
);
eventHub
.
$off
(
EVT_PERF_MARK_FILE_TREE_START
,
treeStart
);
},
};
app/assets/javascripts/performance/constants.js
View file @
cc8057b7
...
...
@@ -29,3 +29,17 @@ export const WEBIDE_MARK_FILE_FINISH = 'webide-file-finished';
export
const
WEBIDE_MEASURE_TREE_FROM_REQUEST
=
'
webide-tree-loading-from-request
'
;
export
const
WEBIDE_MEASURE_FILE_FROM_REQUEST
=
'
webide-file-loading-from-request
'
;
export
const
WEBIDE_MEASURE_FILE_AFTER_INTERACTION
=
'
webide-file-loading-after-interaction
'
;
//
// MR Diffs namespace
// Marks
export
const
MR_DIFFS_MARK_FILE_TREE_START
=
'
mr-diffs-mark-file-tree-start
'
;
export
const
MR_DIFFS_MARK_FILE_TREE_END
=
'
mr-diffs-mark-file-tree-end
'
;
export
const
MR_DIFFS_MARK_DIFF_FILES_START
=
'
mr-diffs-mark-diff-files-start
'
;
export
const
MR_DIFFS_MARK_FIRST_DIFF_FILE_SHOWN
=
'
mr-diffs-mark-first-diff-file-shown
'
;
export
const
MR_DIFFS_MARK_DIFF_FILES_END
=
'
mr-diffs-mark-diff-files-end
'
;
// Measures
export
const
MR_DIFFS_MEASURE_FILE_TREE_DONE
=
'
mr-diffs-measure-file-tree-done
'
;
export
const
MR_DIFFS_MEASURE_DIFF_FILES_DONE
=
'
mr-diffs-measure-diff-files-done
'
;
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