Implement NumericThreshold for Trigger
Implemented NumericThreshold for Trigger that allows to set
expected threshold value for collection of sensors and monitors
if this value is crossed. Implemented detection of direction
when threshold value is crossed. Added initial interface that
is used to commit an action when threshold value is crossed.
Moved Sensor Cache from Report Factory to Telemetry class, now
Sensor Cache is shared between Report Factory and Trigger Factory.
Moved fetching sensor from Dbus to seperate header to have single
implementation for factories.
Disabled tests that uses boost coroutine because of false positive
that is catched by address sanitizer.
Tested:
- Passed unit tests
- Built in yocto envrionment with success
- Telemetry service started successfully in OpenBMC
Change-Id: I1ff7ab96174a27576786f0b9a71554fe1eeff436
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index 340f9b3..464c68b 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -2,6 +2,7 @@
#include "interfaces/trigger_types.hpp"
+#include <chrono>
#include <utility>
class TriggerParams
@@ -49,7 +50,7 @@
return reportNamesProperty;
}
- const TriggerThresholdParams& thresholds() const
+ const TriggerThresholdParams& thresholdParams() const
{
return thresholdsProperty;
}
@@ -61,7 +62,17 @@
bool logToRedfishProperty = false;
bool updateReportProperty = false;
std::vector<std::pair<sdbusplus::message::object_path, std::string>>
- sensorsProperty = {};
- std::vector<std::string> reportNamesProperty = {};
- TriggerThresholdParams thresholdsProperty = {};
+ sensorsProperty = {
+ {sdbusplus::message::object_path(
+ "/xyz/openbmc_project/sensors/temperature/BMC_Temp"),
+ ""}};
+ std::vector<std::string> reportNamesProperty = {"Report1"};
+ TriggerThresholdParams thresholdsProperty =
+ std::vector<numeric::ThresholdParam>{
+ {static_cast<int>(numeric::Type::lowerCritical),
+ std::chrono::milliseconds(10).count(),
+ static_cast<int>(numeric::Direction::decreasing), 0.0},
+ {static_cast<int>(numeric::Type::upperCritical),
+ std::chrono::milliseconds(10).count(),
+ static_cast<int>(numeric::Direction::increasing), 90.0}};
};