Gnome-power-statistics is run when you click on the battery icon in the top panel of a laptop. It shows battery history such as charge and rate, as well as statistics such as discharge profile and discharge accuracy.
The more you use your laptop, the more data it shows, and the more accurate the battery time-to-empty predictions are.
So, where does gnome-power-statistics get the raw historical data from? And, if it also saves any data, where does it save it to?
I've just answered a simular question here, but here is the summary:
UPower's historical information is stored in four files in
/var/lib/upower/
, yours will be different but mine are named:It appears to compile this data from the information in
/sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
which I'm guessing is in turn directly taken from acpi's information on the current battery state at/proc/acpi/battery/BAT0/info
.Hope this helps.
Ubuntu uses
upower
(version 10.4+). Older versions usedDeviceKit-power
(9.10) orHAL
(<9.10).Regarding upower:
From the last link: The
org.freedesktop.UPower
API has aorg.freedesktop.UPower.Device
and that one has a ...to provide data that is used in the graph. I think that the data is cleared when you reboot/shutdown so it is probably real-time and has no history.