rxseger / homebridge-ipmi

IPMI sensor plugin for Homebridge
MIT License
5 stars 4 forks source link

Optimize sensor refreshing efficiency #1

Closed rxseger closed 7 years ago

rxseger commented 7 years ago

Currently, each sensor read calls getSensors(), which runs ipmitool sensor to get all of the values for each sensor, even though only one sensor value is used. This is doubly redundant with getFanOn and getFanRotationSpeed. Sometimes it is even slow enough to cause timeouts on the initial fetch, when all of the sensors are read. Consider optimizing to read all the data at one time, and update a cache at a maximum refresh rate.