gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
8.85k stars 1.2k forks source link

Adds load times to launchpad telemetry context, and adds event for slow loads #3339

Closed axosoft-ramint closed 4 weeks ago

axosoft-ramint commented 4 weeks ago

Some explanation for the current implementation not simply putting the load times on the "on Refreshed" event of the Focus Provider:

  1. Having quickpick commands use event listeners feels a bit weird, and I couldn't find an example of any such commands that set up a disposable and listen for events from other services.
  2. Because of 1, my current implementation plumbs the load times through the functions that fetch the focus items, which feels weird and causes all these updates to shapes to account for those load times.

If there's a way we can get away with returning just the items on getCategorizedItems and returning the load times separately, I'd love to hear some feedback on that.

eamodio commented 4 weeks ago

Hey @axosoft-ramint, while reviewing your PR, I'd suggest the following code changes:

👉 Used new util functions

Added new util functions (already on main), and it should now send the slow event anytime it crosses the threshold, but will now capture the full duration even it if errors out

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest >[Code Suggest](https://gitkraken.dev/redirect/aHR0cHM6Ly93d3cuZ2l0a3Jha2VuLmNvbS9zb2x1dGlvbnMvY29kZS1zdWdnZXN0P3NvdXJjZT1naXRodWIuY29tJm1lZGl1bT1wcl9jb21tZW50?source=PRSuggest&event=redirectToCodeSuggestPage&provider=github) liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR. _Join your team on [GitKraken](https://gitkraken.dev/redirect/aHR0cHM6Ly93d3cuZ2l0a3Jha2VuLmNvbT9zb3VyY2U9Z2l0aHViLmNvbSZtZWRpdW09cHJfY29tbWVudA==?source=PRSuggest&event=redirectToIndexPage&provider=github) to speed up PR review._