systemd-report-power-source@.service, systemd-report-power-source.socket, systemd-report-power-source — Report AC power status and battery state as system report metrics
systemd-report-power-source@.service
systemd-report-power-source.socket
/usr/lib/systemd/systemd-report-power-source
This component is experimental and subject to change without advance notice. It will be stabilized and given a backward-compatibility guarantee in a future release, but may also possibly be removed.
systemd-report-power-source@.service is a metrics source for
systemd-report(1). It
reports whether the system is running on external power, as well as the key parameters of the
system's batteries, as exposed by the kernel's power supply class ("power_supply"), by
implementing the io.systemd.Metrics Varlink interface on a socket linked into the
/run/systemd/report/ directory.
The following system-wide metric is reported, without metric object:
io.systemd.PowerSource.ACPower¶1 if the system is running on external (AC) power, 0 if it is running on battery. Systems without any power supply information (for example most desktop machines and virtual machines) are considered to be running on AC power.
The following metrics are reported for every battery that is present and powers the system,
i.e. batteries of peripheral devices such as mice or keyboards are not included. The metric object is
the kernel's name of the battery, for example "BAT0". Metrics the battery's driver
does not provide are omitted.
io.systemd.PowerSource.BatteryCapacityPercent¶The current charge level of the battery, in percent.
io.systemd.PowerSource.BatteryCycleCount¶The number of charge cycles the battery has undergone over its lifetime.
io.systemd.PowerSource.BatteryHealthPercent¶The capacity of the fully charged battery relative to its design capacity, in percent. Typically decreases as the battery ages, and may exceed 100 for new batteries.
io.systemd.PowerSource.BatteryPowerWatts¶The rate at which the battery is currently being charged or discharged, in Watts.
This is always a non-negative value, use io.systemd.PowerSource.BatteryStatus to determine
the direction.
io.systemd.PowerSource.BatteryStatus¶The charging status of the battery, as reported by the kernel, i.e. one of
"Charging", "Discharging", "Not charging",
"Full" or "Unknown".