Closed rafeca closed 5 years ago
One limitation of this implementation is that if the user opts out from metrics, the metrics reporter service won't initialize and the queue that keeps the events that haven't been sent will grow indefinitely...
This issue is already happening in the welcome
package (code), while the github
package has a fix for it by adding quite a bit of logic.
IMHO this should not be the responsibility of every package that wants to consume the metrics
service: packages shouldn't care about whether users have or not opted in into metrics and ideally the metrics service should always return a reporter
which will log or not depending on the user preferences.
I can implement this solution as part of atom/metrics
if people think that this is the right approach 😃
Sample payload
Thanks for including the sample payload. Seeing this sample made it much easier for me to get a quick feel for these changes. :zap:
IMHO this should not be the responsibility of every package that wants to consume the
metrics
service: packages shouldn't care about whether users have or not opted in into metrics and ideally the metrics service should always return areporter
which will log or not depending on the user preferences.
I agree. :+1:
Can you describe how you'll verify that these changes are having the desired effect?
I've added some extra information in the PR summary 😄
Would it make sense to add a test or two for this new functionality?
Yes! I just added a couple of tests (and they actually made me find an issue when queueing events 😅).
Description of the Change
This PR makes use of the
atom/metrics
package to be able to start logging the time it takes to index a project by the fuzzy finder.The format of the data that's being logged is the following:
fuzzy-finder-v1
metadata
ec
time-to-crawl
el
ripgrep
orfs
)ev
Sample payload
Test plan
atom/telemetry
sends the correct payload to GitHub's backend. To do so, I've had to edit the code of theatom/telemetry
package (more specifically, I've manually modifiednode_modules/telemetry-github/out/index.js
to set the variablethis.isDevMode
tofalse
(code). I've also had to increase how often Atom sends metrics, since by default it only sends them every 24 hours. To do so, I've set the variablesDailyStatsReportIntervalInMs
andReportingLoopIntervalInMs
located in the previous file to something like15000
(code).Alternate Designs
Do not log this?
Benefits
Knowing the time it takes to crawl the project by the fuzzy finder on real users will help us decide how much effort should be put on improving its performance.
Possible Drawbacks
We're logging a little bit more data from users.
Applicable Issues
https://github.com/atom/fuzzy-finder/issues/371
/cc @telliott27