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

Track TensorBoard usage in integrated terminals #15125

Merged
merged 4 commits into from
Jan 12, 2021
Merged

Track TensorBoard usage in integrated terminals #15125

merged 4 commits into from
Jan 12, 2021

Conversation

joyceerhl
Copy link

Per @jmew, collect telemetry on how often TensorBoard is started from an integrated terminal in VS Code. It's possible (but IMO unlikely) that a terminal would have that name and not be running tensorboard.

A more accurate but also more complicated and expensive alternative would be to poll the process tree under each terminal pty and check if any of the terminals' associated processes' children are running tensorboard.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Appropriate comments and documentation strings in the code.
  • [ ] Has sufficient logging.
  • Has telemetry for enhancements.
  • [ ] The wiki is updated with any design decisions/details.

@codecov-io
Copy link

codecov-io commented Jan 12, 2021

Codecov Report

Merging #15125 (4f4a9e8) into main (ef3fe4f) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##            main   #15125   +/-   ##
======================================
  Coverage     65%      65%           
======================================
  Files        560      560           
  Lines      26362    26363    +1     
  Branches    3747     3747           
======================================
+ Hits       17174    17175    +1     
  Misses      8494     8494           
  Partials     694      694           
Impacted Files Coverage Δ
src/client/telemetry/index.ts 76% <ø> (ø)
src/client/telemetry/constants.ts 100% <100%> (ø)

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

@kimadeline kimadeline added the skip tests Updates to tests unnecessary label Jan 12, 2021
// every 5 min or so
const matches = window.terminals.filter((terminal) => terminal.name === 'tensorboard');
if (matches.length > 0) {
sendTelemetryEvent(EventName.TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not fully sure what the PM requirements are on this. If we just care about seeing this once per VS Code session then we could just send this once and turn off the Watcher after that (just to avoid doing something every 5 min and to not log the event repeatedly). But this is just a smidge of work happening every five so seems ok to me as is.

Copy link
Author

@joyceerhl joyceerhl Jan 12, 2021

Choose a reason for hiding this comment

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

Good catch, checked with Jeffrey and we only care about seeing this once per VSCode session. Added clearInterval after sending telemetry (in addition to clearInterval on extension dispose).

// until the user kills it, the terminal with the updated name should
// stick around for long enough that we only need to run this check
// every 5 min or so
const matches = window.terminals.filter((terminal) => terminal.name === 'tensorboard');

Choose a reason for hiding this comment

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

Noob question: is the terminal name always going to be tensorboard, and not C://path/to/tensorboard, or tb or any other alias?

Copy link
Author

Choose a reason for hiding this comment

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

It's possible that users alias the tensorboard command but might also result in false positives. For running with path/to/tensorboard, the terminal name is also tensorboard (at least on my machine).

Choose a reason for hiding this comment

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

No tensorboard.exe on Windows then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants