mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
wip
This commit is contained in:
parent
8bc105b527
commit
9b5b94b515
3 changed files with 7 additions and 2 deletions
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#include <prometheus/simpleapi.h>
|
||||||
|
|
||||||
#define ZT_MEMBER_AUTH_TIMEOUT_NOTIFY_BEFORE 25000
|
#define ZT_MEMBER_AUTH_TIMEOUT_NOTIFY_BEFORE 25000
|
||||||
|
|
||||||
namespace ZeroTier
|
namespace ZeroTier
|
||||||
|
@ -188,6 +190,9 @@ protected:
|
||||||
std::unordered_multimap< uint64_t,uint64_t > _networkByMember;
|
std::unordered_multimap< uint64_t,uint64_t > _networkByMember;
|
||||||
mutable std::mutex _changeListeners_l;
|
mutable std::mutex _changeListeners_l;
|
||||||
mutable std::mutex _networks_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
|
} // namespace ZeroTier
|
||||||
|
|
|
@ -720,6 +720,7 @@ void PostgreSQL::initializeNetworks()
|
||||||
fprintf(stderr, "Took %llu us per network to load\n", (total/count));
|
fprintf(stderr, "Took %llu us per network to load\n", (total/count));
|
||||||
}
|
}
|
||||||
stream.complete();
|
stream.complete();
|
||||||
|
_network_count = count;
|
||||||
|
|
||||||
w.commit();
|
w.commit();
|
||||||
_pool->unborrow(c2);
|
_pool->unborrow(c2);
|
||||||
|
@ -1034,7 +1035,6 @@ void PostgreSQL::heartbeat()
|
||||||
w.commit();
|
w.commit();
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
fprintf(stderr, "%s: Heartbeat update failed: %s\n", controllerId, e.what());
|
fprintf(stderr, "%s: Heartbeat update failed: %s\n", controllerId, e.what());
|
||||||
w.abort();
|
|
||||||
_pool->unborrow(c);
|
_pool->unborrow(c);
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -15,7 +15,7 @@ url = "2.3"
|
||||||
reqwest = "0.11"
|
reqwest = "0.11"
|
||||||
jwt = {version = "0.16", git = "https://github.com/glimberg/rust-jwt"}
|
jwt = {version = "0.16", git = "https://github.com/glimberg/rust-jwt"}
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
time = { version = "0.3", features = ["formatting"] }
|
time = { version = "~0.3", features = ["formatting"] }
|
||||||
bytes = "1.3"
|
bytes = "1.3"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
tokio = { version = ">=1.24" }
|
tokio = { version = ">=1.24" }
|
||||||
|
|
Loading…
Add table
Reference in a new issue