From 7d1583446217487d2b4431c521a810833cef618e Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 6 Dec 2025 10:09:37 -0500 Subject: [PATCH] add prereq logging of last load time for various lookup tables; --- src/common/lookups/AdjSiteMapLookup.cpp | 4 ++++ src/common/lookups/AdjSiteMapLookup.h | 2 ++ src/common/lookups/IdenTableLookup.cpp | 3 +++ src/common/lookups/LookupTable.h | 5 ++++- src/common/lookups/PeerListLookup.cpp | 3 +++ src/common/lookups/RadioIdLookup.cpp | 3 +++ src/common/lookups/TalkgroupRulesLookup.cpp | 4 ++++ src/common/lookups/TalkgroupRulesLookup.h | 2 ++ src/fne/CryptoContainer.cpp | 4 ++++ src/fne/CryptoContainer.h | 2 ++ 10 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/common/lookups/AdjSiteMapLookup.cpp b/src/common/lookups/AdjSiteMapLookup.cpp index 6a43c90e..802a3e99 100644 --- a/src/common/lookups/AdjSiteMapLookup.cpp +++ b/src/common/lookups/AdjSiteMapLookup.cpp @@ -53,6 +53,7 @@ AdjSiteMapLookup::AdjSiteMapLookup(const std::string& filename, uint32_t reloadT m_rulesFile(filename), m_reloadTime(reloadTime), m_rules(), + m_lastLoadTime(0U), m_stop(false), m_adjPeerMap() { @@ -241,6 +242,9 @@ bool AdjSiteMapLookup::load() return false; } + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %lu entries into adjacent site map table", size); return true; diff --git a/src/common/lookups/AdjSiteMapLookup.h b/src/common/lookups/AdjSiteMapLookup.h index d560162c..6f690440 100644 --- a/src/common/lookups/AdjSiteMapLookup.h +++ b/src/common/lookups/AdjSiteMapLookup.h @@ -231,6 +231,8 @@ namespace lookups uint32_t m_reloadTime; yaml::Node m_rules; + uint64_t m_lastLoadTime; + bool m_stop; static std::mutex s_mutex; //!< Mutex used for change locking. diff --git a/src/common/lookups/IdenTableLookup.cpp b/src/common/lookups/IdenTableLookup.cpp index 3d1a4dd1..3f7b9264 100644 --- a/src/common/lookups/IdenTableLookup.cpp +++ b/src/common/lookups/IdenTableLookup.cpp @@ -156,6 +156,9 @@ bool IdenTableLookup::load() if (size == 0U) return false; + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %u entries into lookup table", size); return true; diff --git a/src/common/lookups/LookupTable.h b/src/common/lookups/LookupTable.h index ecd05612..c610d978 100644 --- a/src/common/lookups/LookupTable.h +++ b/src/common/lookups/LookupTable.h @@ -55,7 +55,8 @@ namespace lookups m_filename(filename), m_reloadTime(reloadTime), m_table(), - m_stop(false) + m_stop(false), + m_lastLoadTime(0U) { /* stub */ } @@ -191,6 +192,8 @@ namespace lookups std::unordered_map m_table; bool m_stop; + uint64_t m_lastLoadTime; + /** * @brief Loads the table from the passed lookup table file. * @returns bool True, if lookup table was loaded, otherwise false. diff --git a/src/common/lookups/PeerListLookup.cpp b/src/common/lookups/PeerListLookup.cpp index 14cbd9b1..40e0cff9 100644 --- a/src/common/lookups/PeerListLookup.cpp +++ b/src/common/lookups/PeerListLookup.cpp @@ -293,6 +293,9 @@ bool PeerListLookup::load() if (size == 0U) return false; + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %lu entries into peer list lookup table", size); return true; } diff --git a/src/common/lookups/RadioIdLookup.cpp b/src/common/lookups/RadioIdLookup.cpp index 1e1a2bb9..fd241ebc 100644 --- a/src/common/lookups/RadioIdLookup.cpp +++ b/src/common/lookups/RadioIdLookup.cpp @@ -234,6 +234,9 @@ bool RadioIdLookup::load() if (size == 0U) return false; + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %lu entries into radio ID lookup table", size); return true; diff --git a/src/common/lookups/TalkgroupRulesLookup.cpp b/src/common/lookups/TalkgroupRulesLookup.cpp index 14689043..5f5073e4 100644 --- a/src/common/lookups/TalkgroupRulesLookup.cpp +++ b/src/common/lookups/TalkgroupRulesLookup.cpp @@ -54,6 +54,7 @@ TalkgroupRulesLookup::TalkgroupRulesLookup(const std::string& filename, uint32_t m_rulesFile(filename), m_reloadTime(reloadTime), m_rules(), + m_lastLoadTime(0U), m_acl(acl), m_stop(false), m_groupHangTime(5U), @@ -376,6 +377,9 @@ bool TalkgroupRulesLookup::load() return false; } + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %lu entries into talkgroup rules table", size); return true; diff --git a/src/common/lookups/TalkgroupRulesLookup.h b/src/common/lookups/TalkgroupRulesLookup.h index 4d68de15..fff6c874 100644 --- a/src/common/lookups/TalkgroupRulesLookup.h +++ b/src/common/lookups/TalkgroupRulesLookup.h @@ -641,6 +641,8 @@ namespace lookups uint32_t m_reloadTime; yaml::Node m_rules; + uint64_t m_lastLoadTime; + bool m_acl; bool m_stop; diff --git a/src/fne/CryptoContainer.cpp b/src/fne/CryptoContainer.cpp index 7566894b..2667fca7 100644 --- a/src/fne/CryptoContainer.cpp +++ b/src/fne/CryptoContainer.cpp @@ -145,6 +145,7 @@ CryptoContainer::CryptoContainer(const std::string& filename, const std::string& m_file(filename), m_password(password), m_reloadTime(reloadTime), + m_lastLoadTime(0U), #if !defined(ENABLE_SSL) m_enabled(false), #else @@ -606,6 +607,9 @@ bool CryptoContainer::load() if (size == 0U) return false; + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + m_lastLoadTime = now; + LogInfoEx(LOG_HOST, "Loaded %lu entries into crypto lookup table", size); return true; diff --git a/src/fne/CryptoContainer.h b/src/fne/CryptoContainer.h index 78a3cab7..dab9d3ad 100644 --- a/src/fne/CryptoContainer.h +++ b/src/fne/CryptoContainer.h @@ -250,6 +250,8 @@ private: std::string m_password; uint32_t m_reloadTime; + uint64_t m_lastLoadTime; + bool m_enabled; bool m_stop;