summaryrefslogtreecommitdiff
path: root/redfish-core/include/event_service_manager.hpp
diff options
context:
space:
mode:
authorJonathan Doman <jonathan.doman@intel.com>2021-06-11 19:36:17 +0300
committerKrzysztof Grobelny <krzysztof.grobelny@intel.com>2021-12-28 15:23:02 +0300
commit1e1e598df6d1d9530dde6e92d8f74f8143f60e50 (patch)
treeb71aee4a4c50c79332e14d6e74094693888855a6 /redfish-core/include/event_service_manager.hpp
parent168e20c1306e3e689907ba43e14ea679e2328611 (diff)
downloadbmcweb-1e1e598df6d1d9530dde6e92d8f74f8143f60e50.tar.xz
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with: https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467 * Uncompressed size: 3033148 -> 3012164, -20984 B * gzip compressed size: 1220586 -> 1214625, -5961 B Tested: - Redfish validator output is the same before and after the change Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Diffstat (limited to 'redfish-core/include/event_service_manager.hpp')
-rw-r--r--redfish-core/include/event_service_manager.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 16af1be2a8..9349cd84b0 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -501,7 +501,7 @@ class Subscription : public persistent_data::UserSubscription
#endif
void filterAndSendReports(const std::string& id,
- const dbus::utility::DbusVariantType& var)
+ const telemetry::TimestampReadings& var)
{
std::string mrdUri = telemetry::metricReportDefinitionUri + ("/" + id);
@@ -1328,14 +1328,21 @@ class EventServiceManager
return;
}
- const dbus::utility::DbusVariantType& readings = found->second;
+ const telemetry::TimestampReadings* readings =
+ std::get_if<telemetry::TimestampReadings>(&found->second);
+ if (!readings)
+ {
+ BMCWEB_LOG_INFO << "Failed to get Readings from Report properties";
+ return;
+ }
+
for (const auto& it :
EventServiceManager::getInstance().subscriptionsMap)
{
Subscription& entry = *it.second.get();
if (entry.eventFormatType == metricReportFormatType)
{
- entry.filterAndSendReports(id, readings);
+ entry.filterAndSendReports(id, *readings);
}
}
}