upower (version 10.4+). Older versions used
DeviceKit-power (9.10) or
UPower is an abstraction for enumerating power devices, listening to device events and querying history and statistics. Any application or service on the system can access the org.freedesktop.UPower service via the system message bus. Some operations (such as suspending the system) are restricted using PolicyKit.
UPower was once called DeviceKit-power. UPower aims to make a large chunk of HAL redundant, as HAL is officially deprecated.
From the last link: The
org.freedesktop.UPower API has a
org.freedesktop.UPower.Device and that one has a ...
GetStatistics (in 's' type, out 'a(dd)' data)
Gets statistics for the power device that may be interesting to show
on a graph in the session.
type: The mode for the statistics. Valid types are charging or discharging.
data: The statistics data for the power device.
Each element contains the following members:
value: The value of the percentage point, usually in seconds
accuracy: The accuracy of the prediction in percent.
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.