add prereq logging of last load time for various lookup tables;

r05a04_dev
Bryan Biedenkapp 2 months ago
parent 4f5051e8b6
commit 7d15834462

@ -53,6 +53,7 @@ AdjSiteMapLookup::AdjSiteMapLookup(const std::string& filename, uint32_t reloadT
m_rulesFile(filename), m_rulesFile(filename),
m_reloadTime(reloadTime), m_reloadTime(reloadTime),
m_rules(), m_rules(),
m_lastLoadTime(0U),
m_stop(false), m_stop(false),
m_adjPeerMap() m_adjPeerMap()
{ {
@ -241,6 +242,9 @@ bool AdjSiteMapLookup::load()
return false; return false;
} }
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %lu entries into adjacent site map table", size); LogInfoEx(LOG_HOST, "Loaded %lu entries into adjacent site map table", size);
return true; return true;

@ -231,6 +231,8 @@ namespace lookups
uint32_t m_reloadTime; uint32_t m_reloadTime;
yaml::Node m_rules; yaml::Node m_rules;
uint64_t m_lastLoadTime;
bool m_stop; bool m_stop;
static std::mutex s_mutex; //!< Mutex used for change locking. static std::mutex s_mutex; //!< Mutex used for change locking.

@ -156,6 +156,9 @@ bool IdenTableLookup::load()
if (size == 0U) if (size == 0U)
return false; return false;
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %u entries into lookup table", size); LogInfoEx(LOG_HOST, "Loaded %u entries into lookup table", size);
return true; return true;

@ -55,7 +55,8 @@ namespace lookups
m_filename(filename), m_filename(filename),
m_reloadTime(reloadTime), m_reloadTime(reloadTime),
m_table(), m_table(),
m_stop(false) m_stop(false),
m_lastLoadTime(0U)
{ {
/* stub */ /* stub */
} }
@ -191,6 +192,8 @@ namespace lookups
std::unordered_map<uint32_t, T> m_table; std::unordered_map<uint32_t, T> m_table;
bool m_stop; bool m_stop;
uint64_t m_lastLoadTime;
/** /**
* @brief Loads the table from the passed lookup table file. * @brief Loads the table from the passed lookup table file.
* @returns bool True, if lookup table was loaded, otherwise false. * @returns bool True, if lookup table was loaded, otherwise false.

@ -293,6 +293,9 @@ bool PeerListLookup::load()
if (size == 0U) if (size == 0U)
return false; return false;
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %lu entries into peer list lookup table", size); LogInfoEx(LOG_HOST, "Loaded %lu entries into peer list lookup table", size);
return true; return true;
} }

@ -234,6 +234,9 @@ bool RadioIdLookup::load()
if (size == 0U) if (size == 0U)
return false; return false;
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %lu entries into radio ID lookup table", size); LogInfoEx(LOG_HOST, "Loaded %lu entries into radio ID lookup table", size);
return true; return true;

@ -54,6 +54,7 @@ TalkgroupRulesLookup::TalkgroupRulesLookup(const std::string& filename, uint32_t
m_rulesFile(filename), m_rulesFile(filename),
m_reloadTime(reloadTime), m_reloadTime(reloadTime),
m_rules(), m_rules(),
m_lastLoadTime(0U),
m_acl(acl), m_acl(acl),
m_stop(false), m_stop(false),
m_groupHangTime(5U), m_groupHangTime(5U),
@ -376,6 +377,9 @@ bool TalkgroupRulesLookup::load()
return false; return false;
} }
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %lu entries into talkgroup rules table", size); LogInfoEx(LOG_HOST, "Loaded %lu entries into talkgroup rules table", size);
return true; return true;

@ -641,6 +641,8 @@ namespace lookups
uint32_t m_reloadTime; uint32_t m_reloadTime;
yaml::Node m_rules; yaml::Node m_rules;
uint64_t m_lastLoadTime;
bool m_acl; bool m_acl;
bool m_stop; bool m_stop;

@ -145,6 +145,7 @@ CryptoContainer::CryptoContainer(const std::string& filename, const std::string&
m_file(filename), m_file(filename),
m_password(password), m_password(password),
m_reloadTime(reloadTime), m_reloadTime(reloadTime),
m_lastLoadTime(0U),
#if !defined(ENABLE_SSL) #if !defined(ENABLE_SSL)
m_enabled(false), m_enabled(false),
#else #else
@ -606,6 +607,9 @@ bool CryptoContainer::load()
if (size == 0U) if (size == 0U)
return false; return false;
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
m_lastLoadTime = now;
LogInfoEx(LOG_HOST, "Loaded %lu entries into crypto lookup table", size); LogInfoEx(LOG_HOST, "Loaded %lu entries into crypto lookup table", size);
return true; return true;

@ -250,6 +250,8 @@ private:
std::string m_password; std::string m_password;
uint32_t m_reloadTime; uint32_t m_reloadTime;
uint64_t m_lastLoadTime;
bool m_enabled; bool m_enabled;
bool m_stop; bool m_stop;

Loading…
Cancel
Save

Powered by TurnKey Linux.