SWDEV-223878 - Add cache manager and watch table to skeleton rdc_lib

Support cache manager and watch table in rdc_lib

RdcCacheManagerImpl.cc is added to implement cache of metrics. Currently, only
integer mertics are supported. The cache manager provids function to retrieve the
latest and history metrics from cache. It also provides interfaces to update and evict the cache.

RdcWatchTableImpl.cc is added to implement watch and unwatch fields. It uses the
field settings to control how frequently a field needs to be updated. We have a preliminarily
performance optimization for this class as it may be called very frequently.

RdcMetricsUpdaterImpl.cc is added to run the update at background thread when
RDC_OPERATION_MODE_AUTO is set.

After this code change, the rdcd/rdci should be able to implement basic discovery, group and dmon
function. The job management function is not implemented in the skeleton rdc_lib yet.

Change-Id: I26cff8c2ec85d1ad8e7df24c66b02f0060838d37
Cette révision appartient à :
Bill(Shuzhou) Liu
2020-02-26 11:04:42 -05:00
révisé par Chris Freehill
Parent a5f063f8b3
révision 1ff1c7b617
20 fichiers modifiés avec 1007 ajouts et 34 suppressions
+7
Voir le fichier
@@ -25,6 +25,9 @@ THE SOFTWARE.
#include "rdc_lib/RdcHandler.h"
#include "rdc_lib/RdcGroupSettings.h"
#include "rdc_lib/RdcMetricFetcher.h"
#include "rdc_lib/RdcCacheManager.h"
#include "rdc_lib/RdcMetricsUpdater.h"
#include "rdc_lib/RdcWatchTable.h"
namespace amd {
namespace rdc {
@@ -80,10 +83,14 @@ class RdcEmbeddedHandler: public RdcHandler {
rdc_status_t rdc_update_all_fields(uint32_t wait_for_update) override;
explicit RdcEmbeddedHandler(rdc_operation_mode_t op_mode);
~RdcEmbeddedHandler();
private:
RdcGroupSettingsPtr group_settings_;
RdcCacheManagerPtr cache_mgr_;
RdcMetricFetcherPtr metric_fetcher_;
RdcWatchTablePtr watch_table_;
RdcMetricsUpdaterPtr metrics_updater_;
};
} // namespace rdc