Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some instrumentation #1744

merged 5 commits into from Oct 17, 2018

Add some instrumentation #1744

merged 5 commits into from Oct 17, 2018


Copy link

@vanessayuenn vanessayuenn commented Oct 12, 2018

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.


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


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() {

assert.isTrue(cloneRepositoryForProjectPath.calledWith('', '/home/me/github'));
assert.isTrue(reporterProxy.addEvent.calledWith('clone-repo', {package: 'github'}))

This comment has been minimized.


kuychaco Oct 16, 2018

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'}));
Copy link

@coveralls 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
7 checks passed
7 checks passed
ci/circleci: beta Your tests passed on CircleCI!
ci/circleci: dev Your tests passed on CircleCI!
ci/circleci: snapshot Your tests passed on CircleCI!
ci/circleci: stable Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage decreased (-0.06%) to 81.784%
@vanessayuenn vanessayuenn deleted the vy-instrumentation branch Oct 17, 2018
@annthurium annthurium mentioned this pull request Oct 20, 2018
7 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

4 participants