author | Florian Forster <octo@collectd.org> | |
Wed, 10 Sep 2014 14:53:51 +0000 (16:53 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 10 Sep 2014 14:57:03 +0000 (16:57 +0200) | ||
commit | 7186f6716d2c588a3bdb19d849a99380db1f3081 | |
tree | cd6013737340881ae6d3b2e096dccc5a0f3fe005 | tree | snapshot |
parent | 9901983046c6a4e2793c060b3c10b4c7d467f813 | commit | diff |
battery plugin: Import code to read metrics from sysfs.
This started as a simple import of Andy Parkins' sysfsbattery plugin into
the battery plugin. Since the battery plugin is ancient and hasn't been
touched in a while, this quickly escalated to a much bigger refactoring.
Sorry!
On the other hand, this fixes a couple of bugs. For example, all metrics
were always dispatched with plugin_instance "0". This is correct for the
majority of laptops, of course, but in theory this could be wrong.
Also ACPI charging / discharging rate is reported as "current", when
modern batteries actually report "power". The sysfs code does this
correctly, ACPI still needs to be patched.
Fixes: #725
This started as a simple import of Andy Parkins' sysfsbattery plugin into
the battery plugin. Since the battery plugin is ancient and hasn't been
touched in a while, this quickly escalated to a much bigger refactoring.
Sorry!
On the other hand, this fixes a couple of bugs. For example, all metrics
were always dispatched with plugin_instance "0". This is correct for the
majority of laptops, of course, but in theory this could be wrong.
Also ACPI charging / discharging rate is reported as "current", when
modern batteries actually report "power". The sysfs code does this
correctly, ACPI still needs to be patched.
Fixes: #725
src/battery.c | diff | blob | history |