Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add some instrumentation #1744

Merged
merged 5 commits into from Oct 17, 2018
Merged

Add some instrumentation #1744

merged 5 commits into from Oct 17, 2018

Conversation

vanessayuenn
Copy link
Contributor

Description of the Change

This PR adds reporting metrics for cloning repos, as well as various context menu actions within the package.

Alternate Designs

This implementation listens to all command dispatch event, filters out the ones triggered via context menus, and acts upon them. The drawback is that it won't be clear exactly which context menu was used to trigger that command. An alternative approach would be to hook into each event we're interested in individually, and reports back if the event came from a context menu, and which one. But this approach would result in the same code scattered all over the place, which isn't ideal either.

Metrics

We can know how much usage context menus get, how discoverable the clone repo functionality is.

Tests

I only added tests for the clone repo instrumentation, but not the context menu ones as I can't think of how one can test context menus in our situation.

Related Issues

resolves #1727
resolves #1728

@@ -351,6 +352,7 @@ describe('RootController', function() {
resolveClone();

assert.isTrue(cloneRepositoryForProjectPath.calledWith('git@github.com:atom/github.git', '/home/me/github'));
assert.isTrue(reporterProxy.addEvent.calledWith('clone-repo', {package: 'github'}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like addEvent gets called asynchronously after the cloneRepositoryForProjectPath promise is resolved. We can account for this using our async assertion (courtesy of @BinaryMuse ✨):

      await assert.async.isTrue(reporterProxy.addEvent.calledWith('clone-repo', {package: 'github'}));

@coveralls
Copy link

coveralls commented Oct 17, 2018

Coverage Status

Coverage decreased (-0.06%) to 81.784% when pulling 668541d on vy-instrumentation into 3703f57 on master.

@vanessayuenn vanessayuenn merged commit 27f944a into master Oct 17, 2018
@vanessayuenn vanessayuenn deleted the vy-instrumentation branch October 17, 2018 18:38
@annthurium annthurium mentioned this pull request Oct 20, 2018
7 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

figure out a way of instrumenting context menu actions Add metrics for cloning
4 participants