mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-06 04:51:46 -07:00
Add prom metrics for Central controller specific things
This commit is contained in:
parent
328180d2e5
commit
09d7132be0
3 changed files with 30 additions and 1 deletions
|
@ -119,6 +119,7 @@ MemberNotificationReceiver::MemberNotificationReceiver(PostgreSQL *p, pqxx::conn
|
|||
|
||||
void MemberNotificationReceiver::operator() (const std::string &payload, int packend_pid) {
|
||||
fprintf(stderr, "Member Notification received: %s\n", payload.c_str());
|
||||
_mem_notifications++;
|
||||
json tmp(json::parse(payload));
|
||||
json &ov = tmp["old_val"];
|
||||
json &nv = tmp["new_val"];
|
||||
|
@ -141,6 +142,7 @@ NetworkNotificationReceiver::NetworkNotificationReceiver(PostgreSQL *p, pqxx::co
|
|||
|
||||
void NetworkNotificationReceiver::operator() (const std::string &payload, int packend_pid) {
|
||||
fprintf(stderr, "Network Notification received: %s\n", payload.c_str());
|
||||
_net_notifications++;
|
||||
json tmp(json::parse(payload));
|
||||
json &ov = tmp["old_val"];
|
||||
json &nv = tmp["new_val"];
|
||||
|
@ -1233,6 +1235,7 @@ void PostgreSQL::_networksWatcher_Redis() {
|
|||
}
|
||||
lastID = id;
|
||||
}
|
||||
_redis_net_notif++;
|
||||
}
|
||||
}
|
||||
} catch (sw::redis::Error &e) {
|
||||
|
@ -1791,6 +1794,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;
|
||||
_redis_mem_notif++;
|
||||
}
|
||||
|
||||
// expire records from all-nodes and network-nodes member list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue