mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-31 08:25:38 +00:00
wip
This commit is contained in:
parent
8bc105b527
commit
9b5b94b515
@ -35,6 +35,8 @@
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <prometheus/simpleapi.h>
|
||||
|
||||
#define ZT_MEMBER_AUTH_TIMEOUT_NOTIFY_BEFORE 25000
|
||||
|
||||
namespace ZeroTier
|
||||
@ -188,6 +190,9 @@ protected:
|
||||
std::unordered_multimap< uint64_t,uint64_t > _networkByMember;
|
||||
mutable std::mutex _changeListeners_l;
|
||||
mutable std::mutex _networks_l;
|
||||
|
||||
prometheus::simpleapi::counter_metric_t _network_count { "contrller_network_count", "number of networks the controller is serving" };
|
||||
prometheus::simpleapi::counter_metric_t _member_count { "controller_member_count", "number of network members the controller is serving" };
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
@ -720,6 +720,7 @@ void PostgreSQL::initializeNetworks()
|
||||
fprintf(stderr, "Took %llu us per network to load\n", (total/count));
|
||||
}
|
||||
stream.complete();
|
||||
_network_count = count;
|
||||
|
||||
w.commit();
|
||||
_pool->unborrow(c2);
|
||||
@ -1034,7 +1035,6 @@ void PostgreSQL::heartbeat()
|
||||
w.commit();
|
||||
} catch (std::exception &e) {
|
||||
fprintf(stderr, "%s: Heartbeat update failed: %s\n", controllerId, e.what());
|
||||
w.abort();
|
||||
_pool->unborrow(c);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
continue;
|
||||
|
@ -15,7 +15,7 @@ url = "2.3"
|
||||
reqwest = "0.11"
|
||||
jwt = {version = "0.16", git = "https://github.com/glimberg/rust-jwt"}
|
||||
serde = "1.0"
|
||||
time = { version = "0.3", features = ["formatting"] }
|
||||
time = { version = "~0.3", features = ["formatting"] }
|
||||
bytes = "1.3"
|
||||
thiserror = "1"
|
||||
tokio = { version = ">=1.24" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user