Description
Background
Currently the disk buffering exporter attempts to export every 10 seconds - the WorkDelegator
has a loop of 10 second to check, if the PeriodicRunnable
isReadyToRun()
:
... and the DefaultExportScheduler
uses the same 10 seconds waiting period to show its readiness:
Problem
Since my internal enterprise apps are used by colleagues 8 hours a day it is critical to not put too much strain on their phone's batteries. The 10 second exporting frequency means that the phone has to do IO 2880 times during an 8 hour workday, if my Maths is correct, which feels like a lot both for the devices and for the backend to handle as well, if the number of devices is high.
Proposed solution
I would increase the default exporting frequency to 1 minute. Additionally, I would create a new config parameter in DiskBufferingConfig
, which allows setting the exporting frequency catering for various preferences on the tradoff between real-time-ness and battery consumption.
Alternatively or additionally, the WorkManager
API could be used (#882), which raises the minimum frequency to 1x in 15 minutes and optimizes the battery life even better.