Skip to content

User timing performance marks and measurements for snippets

Denys Mishunov requested to merge dmishunov-snippet-user-timing into master

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.

This is not a user-facing change, hence no changelog entry has been provided.

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:

  1. 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.
  2. 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 Screenshot_2020-07-29_at_11.05.19 Screenshot_2020-07-29_at_11.06.29
Multi-file snippet Screenshot_2020-07-29_at_11.00.38 Screenshot_2020-07-29_at_10.57.16 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

Availability and Testing

References #238972 (closed)

Edited by Denys Mishunov

Merge request reports