report peer identity string in influx data; make sure non-alternate port reporting properly reports peer identity;

pull/55/head
Bryan Biedenkapp 2 years ago
parent e57541c135
commit 9cfde0e57e

@ -230,6 +230,7 @@ void* DiagNetwork::threadedNetworkRx(void* arg)
influxdb::QueryBuilder()
.meas("activity")
.tag("peerId", std::to_string(peerId))
.field("identity", connection->identity())
.field("msg", payload)
.timestamp(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
.request(network->m_influxServer);
@ -266,6 +267,7 @@ void* DiagNetwork::threadedNetworkRx(void* arg)
influxdb::QueryBuilder()
.meas("diag")
.tag("peerId", std::to_string(peerId))
.field("identity", connection->identity())
.field("msg", payload)
.timestamp(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
.request(network->m_influxServer);

@ -884,13 +884,14 @@ void* FNENetwork::threadedNetworkRx(void* arg)
::memcpy(rawPayload, req->buffer + 11U, req->length - 11U);
std::string payload(rawPayload, rawPayload + (req->length - 11U));
::ActivityLog("%u %s", peerId, payload.c_str());
::ActivityLog("%u (%8s) %s", peerId, connection->identity().c_str(), payload.c_str());
// report activity log to InfluxDB
if (network->m_enableInfluxDB) {
influxdb::QueryBuilder()
.meas("activity")
.tag("peerId", std::to_string(peerId))
.field("identity", connection->identity())
.field("msg", payload)
.timestamp(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
.request(network->m_influxServer);
@ -919,7 +920,7 @@ void* FNENetwork::threadedNetworkRx(void* arg)
bool currState = g_disableTimeDisplay;
g_disableTimeDisplay = true;
::Log(9999U, nullptr, "%u %s", peerId, payload.c_str());
::Log(9999U, nullptr, "%u (%8s) %s", peerId, connection->identity().c_str(), payload.c_str());
g_disableTimeDisplay = currState;
// report diagnostic log to InfluxDB
@ -927,6 +928,7 @@ void* FNENetwork::threadedNetworkRx(void* arg)
influxdb::QueryBuilder()
.meas("diag")
.tag("peerId", std::to_string(peerId))
.field("identity", connection->identity())
.field("msg", payload)
.timestamp(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
.request(network->m_influxServer);

Loading…
Cancel
Save

Powered by TurnKey Linux.