snowplow / snowplow-android-tracker

Snowplow event tracker for Android. Add analytics to your Android apps and games
http://snowplowanalytics.com
Apache License 2.0
107 stars 63 forks source link

Updates to internal emitter #659

Closed matus-tomlein closed 5 months ago

matus-tomlein commented 5 months ago

Change default emit timeout from 5 seconds to 30 seconds (#658) The default timeout for the whole request duration in emitter was set to 5 seconds. This is far from being sufficient on mobile and is a likely cause of the large number of duplicate event reports that we have seen. On slow connections, the request may easily take more than 5 seconds, especially if the phone is switching between cellular and wifi connections.

I have changed it to 30s as we already have a 15s timeout for connection and 15s timeout for read response in the okhttp client config. On iOS, we don't change the default request timeouts which are set to 60 seconds.

Update Emitter constructor to accept namespace and event store and make them immutable Similar to the change on iOS, this moves the namespace and event store to the constructor of the Emitter. This enables removing some optional and makes the properties immutable and safer.

Fix returning error from network connection requests This is a fix for a bug that prevented us returning an error value to the emitter when executing a request.

Remove unused threadCount property from Tracker Minor update that just removes an unused property in the tracker which confused me (there is a similar one in the emitter config).

Set default thread count in Executor to match the default thread pool size in the Emitter Updates the default thread count in Executor to match the default thread pool size in emitter config. The thread count in Executor is controlled by the thread pool size in the emitter.