remove peer status reporting to influx; allow the host to transmit status messages to FNE at 2 second interval instead of 5 second interval; change peer watch update time to 250ms;

pull/72/head
Bryan Biedenkapp 1 year ago
parent 5fc266b457
commit e11758a06a

@ -305,21 +305,6 @@ void* DiagNetwork::threadedNetworkRx(void* arg)
// validate peer (simple validation really)
if (connection->connected() && connection->address() == ip) {
UInt8Array __rawPayload = std::make_unique<uint8_t[]>(req->length - 11U);
uint8_t* rawPayload = __rawPayload.get();
::memset(rawPayload, 0x00U, req->length - 11U);
::memcpy(rawPayload, req->buffer + 11U, req->length - 11U);
std::string payload(rawPayload, rawPayload + (req->length - 11U));
influxdb::QueryBuilder()
.meas("peer_status")
.tag("peerId", std::to_string(peerId))
.field("identity", connection->identity())
.field("status", payload)
.timestamp(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
.request(network->m_influxServer);
// repeat traffic to the connected peers
if (network->m_peers.size() > 0U) {
uint32_t i = 0U;
for (auto peer : network->m_peers) {

@ -1973,7 +1973,7 @@ void* Host::threadSiteData(void* arg)
::pthread_setname_np(th->thread, threadName.c_str());
#endif // _GNU_SOURCE
Timer networkPeerStatusNotify(1000U, 5U);
Timer networkPeerStatusNotify(1000U, 2U);
networkPeerStatusNotify.start();
StopWatch stopWatch;

@ -400,7 +400,8 @@ public:
void update()
{
const auto& rootWidget = getRootWidget();
for (auto entry : getNetwork()->peerStatus) {
std::map<uint32_t, json::object> peerStatus(getNetwork()->peerStatus.begin(), getNetwork()->peerStatus.end());
for (auto entry : peerStatus) {
auto it = std::find_if(m_nodes.begin(), m_nodes.end(), [&](NodeStatusWidget* wdgt) {
if (wdgt->peerId == entry.first && wdgt->uniqueId == (int32_t)entry.first)
return true;
@ -826,7 +827,7 @@ private:
killed = wnd->m_killed;
}
Thread::sleep(1000U);
Thread::sleep(250U);
} else {
break;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.