add Associations endpoints change delay timer
When multiple associations that point to the same interface are
created, each change (adding or removing one) leads to updating
"endpoints" property on dbus. This property update is time consuming
with many endpoints already present, because each update needs to send
the whole list of current elements plus/minus one. With a lot of
changes in short time it can cause the service to be unresponsive.
This change adds timer to delay updating dbus property. This way many
associations updates can be aggregated into single dbus property
update.
Tested: Ran on hardware with dbus sensor tester. 4000 created sensors
with interfaces are processed within 10 seconds. Time before the change
was above 2 minutes.
Signed-off-by: Kallas, Pawel <pawel.kallas@intel.com>
Change-Id: I1083c027ab12238249cffc67fb29a8ffef6baf83
diff --git a/src/processing.hpp b/src/processing.hpp
index 3777ff4..d33f15f 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -52,6 +52,7 @@
/** @brief Handle the removal of an existing name in objmgr data structures
*
+ * @param[in] io - io context
* @param[in,out] nameOwners - Map of unique name to well known name
* @param[in] wellKnown - Well known name that has new owner
* @param[in] oldOwner - Old unique name
@@ -61,6 +62,7 @@
*
*/
void processNameChangeDelete(
+ boost::asio::io_context& io,
boost::container::flat_map<std::string, std::string>& nameOwners,
const std::string& wellKnown, const std::string& oldOwner,
InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
@@ -68,6 +70,7 @@
/** @brief Handle an interfaces added signal
*
+ * @param[in] io - io context
* @param[in,out] interfaceMap - Global map of interfaces
* @param[in] objPath - New path to process
* @param[in] interfacesAdded - New interfaces to process
@@ -76,7 +79,8 @@
* @param[in,out] server - sdbus system object
*
*/
-void processInterfaceAdded(InterfaceMapType& interfaceMap,
+void processInterfaceAdded(boost::asio::io_context& io,
+ InterfaceMapType& interfaceMap,
const sdbusplus::message::object_path& objPath,
const InterfacesAdded& intfAdded,
const std::string& wellKnown,