User timing performance marks and measurements for snippets
What does this MR do?
This is an implementation MR for gitlab-org/frontend/rfcs#51 (closed).
It adds performance.mark
and performance.measure
events triggers to measure the user timing performance on Snippets. More context on the User Timing can be found on MDN.
How to click-test the multi-file scenario?
The whole multi-file snippets functionality is behind a feature flag. So here are the instructions for the click-testing:
- In Rails console (
rails -c
) enable the:snippet_multiple_files
flag. This will allow you too add more than just one file to a snippet. - Since adding/removing files to a snippet through web interface is still a wip, you will have to add files in git:
- Create a new snippet via web interface with a simple dummy file
- Clone the snippet to your FS (URL can be copied using the blue "Clone" button on the snippet view)
- On the FS, add more files to your repo and follow the standard procedure of adding/committing/pushing files to your snippet
- Reload the snippet in your browser.
What to expect? You should see all of your added files in the web interface with the correct content.
Screenshots
Snippet View | Snippet Edit | Notes | |
---|---|---|---|
Single file snippet | ![]() |
![]() |
|
Multi-file snippet | ![]() |
![]() |
In the multi-file scenario, we measure and mark the time for the very first blob only to avoid noise |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
- [x]Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
-
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
References #238972 (closed)
Edited by Denys Mishunov