Skip to content

Simplify import telemetry#5246

Merged
brettcannon merged 5 commits into
microsoft:masterfrom
brettcannon:hash-imports
Apr 15, 2019
Merged

Simplify import telemetry#5246
brettcannon merged 5 commits into
microsoft:masterfrom
brettcannon:hash-imports

Conversation

@brettcannon

Copy link
Copy Markdown
Member

For #4852 , #4718

We only care about top-level packages, so we can simplify the code a bit and rely on Python's own syntax a bit more. We also only care about imports in opened or saved files, and so we can drop caring about anything else. Lastly, check whether we have sent the import already based on its unhashed name to avoid the CPU cost of the hash to begin with.

  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated

We only care about the top-level package, so scale back what we are sending in telemetry.
We also want to avoid hashing, so store locally the unhashed names for comparison instead of the hashes.
@brettcannon brettcannon requested a review from rchiodo April 12, 2019 23:44
Comment thread src/client/telemetry/importTracker.ts

@rchiodo rchiodo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

Don't waste time sending the same telemetry twice and ignore relative imports.
@brettcannon brettcannon merged commit ee83e54 into microsoft:master Apr 15, 2019
@brettcannon brettcannon deleted the hash-imports branch April 15, 2019 18:06
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants