atom / telemetry

sends usage metrics to GitHub's internal analytics pipeline
MIT License
11 stars 12 forks source link

Easier debugging #24

Closed rafeca closed 5 years ago

rafeca commented 5 years ago

Description of the Change

This PR adds another parameter to the constructor of the telemetry package to allow to pass it additional config params.

I've decided to go through this path to not cause a breaking change, but it may make sense to change the API (I don't have strong feeling about it).

The added parameters will make it easier to debug telemetry events without having to modify the code:

Testing plan

Tested as part of https://github.com/atom/metrics/pull/110

Alternate Designs

The API could be different (e.g add the other constructor arguments to the options object).

Benefits

Much easier debugging of metrics. The current way to verify that a new metric is sent correctly is quite manual:

Check that atom/telemetry sends the correct payload to GitHub's backend. To do so, I've had to edit the code of the atom/telemetry package (more specifically, I've manually modified node_modules/telemetry-github/out/index.js to set the variable this.isDevMode to false (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 variables DailyStatsReportIntervalInMs and ReportingLoopIntervalInMs located in the previous file to something like 15000 (code).

Possible Drawbacks

N/A

Applicable Issues

N/A

rafeca commented 5 years ago

BTW thanks @annthurium for adding typescript to this project! it makes it so much easier to change things!