diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-04 19:21:56 -0500 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-04 19:21:56 -0500 |
commit | 694709f3925796a363792871f0453a4f36679c71 (patch) | |
tree | c8703ae2a5b9d4f78c8c6a62c7e1699592902d6f | |
parent | 16613ab5fb5a1f6cb1271ae67e68836a1898023d (diff) | |
download | infinitytier-694709f3925796a363792871f0453a4f36679c71.tar.gz infinitytier-694709f3925796a363792871f0453a4f36679c71.zip |
Add timestamp to network status.
-rw-r--r-- | controller/RethinkDB.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/controller/RethinkDB.cpp b/controller/RethinkDB.cpp index 00c17d2b..297d2c7d 100644 --- a/controller/RethinkDB.cpp +++ b/controller/RethinkDB.cpp @@ -275,17 +275,18 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Address &myAddres std::lock_guard<std::mutex> l2(i->second->lock); tmpobj["authorizedMemberCount"] = i->second->authorizedMembers.size(); tmpobj["totalMemberCount"] = i->second->members.size(); - unsigned long activeMemberCount = 0; + unsigned long onlineMemberCount = 0; for(auto m=i->second->members.begin();m!=i->second->members.end();++m) { auto lo = lastOnlineCumulative.find(std::pair<uint64_t,uint64_t>(i->first,m->first)); if (lo != lastOnlineCumulative.end()) { if ((now - lo->second) <= (ZT_NETWORK_AUTOCONF_DELAY * 2)) - ++activeMemberCount; + ++onlineMemberCount; else lastOnlineCumulative.erase(lo); } } - tmpobj["activeMemberCount"] = activeMemberCount; + tmpobj["onlineMemberCount"] = onlineMemberCount; tmpobj["bridgeCount"] = i->second->activeBridgeMembers.size(); + tmpobj["ts"] = now; } batch.emplace_back(tmpobj); if (batch.size() >= 1024) { |