summaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2023-04-25 12:44:18 -0700
committerGitHub <[email protected]>2023-04-25 12:44:18 -0700
commite4cb74896b01e96b5feb09b9bc906ae818b6ff5d (patch)
tree89967a72584361aa31111f729f545b59f9feadfe /controller
parent8e6e4ede6d17d1cf3c012269ab29e1c58568476e (diff)
Central startup update (#1973)
* allow specifying authtoken in central startup * set allowManagedFrom * move redis_mem_notification to the correct place * add node checkins metric * wire up min/max connection pool size metrics
Diffstat (limited to 'controller')
-rw-r--r--controller/ConnectionPool.hpp2
-rw-r--r--controller/PostgreSQL.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/controller/ConnectionPool.hpp b/controller/ConnectionPool.hpp
index 97a20639..916f5356 100644
--- a/controller/ConnectionPool.hpp
+++ b/controller/ConnectionPool.hpp
@@ -61,6 +61,8 @@ public:
, m_minPoolSize(min_pool_size)
, m_factory(factory)
{
+ Metrics::max_pool_size += max_pool_size;
+ Metrics::min_pool_size += min_pool_size;
while(m_pool.size() < m_minPoolSize){
m_pool.push_back(m_factory->create());
Metrics::pool_avail++;
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp
index ae705bb3..00b61bc3 100644
--- a/controller/PostgreSQL.cpp
+++ b/controller/PostgreSQL.cpp
@@ -1145,6 +1145,7 @@ void PostgreSQL::_membersWatcher_Redis() {
_redis->xdel(key, id);
}
lastID = id;
+ Metrics::redis_mem_notification++;
}
}
}
@@ -1687,6 +1688,7 @@ void PostgreSQL::onlineNotification_Postgres()
<< " ON CONFLICT (network_id, member_id) DO UPDATE SET address = EXCLUDED.address, last_updated = EXCLUDED.last_updated";
pipe.insert(memberUpdate.str());
+ Metrics::pgsql_node_checkin++;
}
while(!pipe.empty()) {
pipe.retrieve();
@@ -1794,7 +1796,7 @@ uint64_t PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &con
.sadd("network-nodes-all:{"+controllerId+"}:"+networkId, memberId)
.hmset("member:{"+controllerId+"}:"+networkId+":"+memberId, record.begin(), record.end());
++count;
- Metrics::redis_mem_notification++;
+ Metrics::redis_node_checkin++;
}
// expire records from all-nodes and network-nodes member list