Comment 122 for bug 629258

Revision history for this message
Brian Rogers (brian-rogers) wrote :

Yeah, it's fairly inaccurate because upower samples the battery only every 30 seconds, and many batteries only report charge level in increments of a whole percent. So the estimator doesn't have precise data for the charge level when it takes a reading, and when it sees a change, all it knows is that that happened some time in the last 30 seconds.

With the version in my PPA, the estimates are projections from alternating readings of "the battery discharged 1% in 30 seconds" and "the battery discharged 1% in 60 seconds" or something similar to that. I've done some experiments on my laptop with code that enforces a minimum time interval and discharge amount before producing an estimate, and it helps, but the estimates still fluctuate a bit.

I'd like to at least have a moving average estimate of the current (and therefore time remaining) before submitting my patch. Or ideally, use all that nice charge and discharge profile data that upower collects.