IpmbSensor : Add PollRate property.
In existing IpmbSensor code, pollrate value is fixed as 1 sec.
We have OCP YosemiteV2 target which has 4 removable host, each host
has 70(x4) sensors. More number of sensor will leads to CPU usage.
Also IPMB Version does not require to read the version for every second.
Therefore, pollRate property can be added in the EM file and based on
those values each sensor/version can be read and updated. Hence CPU
utilization also reduces.
CPU load - pollRate is 1 sec.
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
323 1 root R 8200 2% 16% /usr/bin/ipmbsensor
CPU load - pollRate is 5 sec.
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
294 1 root S 8124 2% 6% /usr/bin/ipmbsensor
TESTED: Tested in yosemitev2 by giving different PollRate
to each sensor and verified.
Signed-off-by: Jayashree Dhanapal <jayashree-d@hcl.com>
Change-Id: I1f80d426699b11a1ac8c33137d12319df429620e
diff --git a/include/IpmbSensor.hpp b/include/IpmbSensor.hpp
index 4effd18..18d10c1 100644
--- a/include/IpmbSensor.hpp
+++ b/include/IpmbSensor.hpp
@@ -81,7 +81,7 @@
sdbusplus::asio::object_server& objectServer,
std::vector<thresholds::Threshold>&& thresholds,
uint8_t deviceAddress, uint8_t hostSMbusIndex,
- std::string& sensorTypeName);
+ const float pollRate, std::string& sensorTypeName);
~IpmbSensor() override;
void checkThresholds(void) override;
@@ -105,6 +105,7 @@
std::vector<uint8_t> commandData;
std::optional<uint8_t> initCommand;
std::vector<uint8_t> initData;
+ int sensorPollMs;
ReadingFormat readingFormat;