track active call counts (this might be slightly error prone, so we will at best call this an approximate number);

r05a04_dev
Bryan Biedenkapp 2 months ago
parent c04ec02f15
commit 3ba3ab33bb

@ -143,6 +143,7 @@ FNENetwork::FNENetwork(HostFNE* host, const std::string& address, uint16_t port,
m_verbosePacketData(false),
m_sndcpStartAddr(__IP_FROM_STR("10.10.1.10")),
m_sndcpEndAddr(__IP_FROM_STR("10.10.1.254")),
m_totalActiveCalls(0U),
m_totalCallsProcessed(0U),
m_logDenials(false),
m_logUpstreamCallStartEnd(true),

@ -406,6 +406,7 @@ namespace network
uint32_t m_sndcpStartAddr;
uint32_t m_sndcpEndAddr;
int32_t m_totalActiveCalls;
uint64_t m_totalCallsProcessed;
bool m_logDenials;

@ -127,6 +127,10 @@ bool TagAnalogData::processFrame(const uint8_t* data, uint32_t len, uint32_t pee
else if (!fromUpstream)
LogInfoEx(LOG_MASTER, CALL_END_LOG);
m_network->m_totalActiveCalls--;
if (m_network->m_totalActiveCalls < 0)
m_network->m_totalActiveCalls = 0;
// report call event to InfluxDB
if (m_network->m_enableInfluxDB) {
influxdb::QueryBuilder()
@ -266,6 +270,7 @@ bool TagAnalogData::processFrame(const uint8_t* data, uint32_t len, uint32_t pee
m_status.unlock();
m_network->m_totalCallsProcessed++;
m_network->m_totalActiveCalls++;
#define CALL_START_LOG "Analog, Call Start, peer = %u, ssrc = %u, srcId = %u, dstId = %u, streamId = %u, fromUpstream = %u", peerId, ssrc, srcId, dstId, streamId, fromUpstream
if (m_network->m_logUpstreamCallStartEnd && fromUpstream)

@ -207,6 +207,10 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
LogInfoEx(LOG_MASTER, CALL_END_LOG);
}
m_network->m_totalActiveCalls--;
if (m_network->m_totalActiveCalls < 0)
m_network->m_totalActiveCalls = 0;
// report call event to InfluxDB
if (m_network->m_enableInfluxDB) {
influxdb::QueryBuilder()
@ -367,6 +371,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
m_status.unlock();
m_network->m_totalCallsProcessed++;
m_network->m_totalActiveCalls++;
// is this a private call?
if (flco == FLCO::PRIVATE) {

@ -246,6 +246,10 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
LogInfoEx(LOG_MASTER, CALL_END_LOG);
}
m_network->m_totalActiveCalls--;
if (m_network->m_totalActiveCalls < 0)
m_network->m_totalActiveCalls = 0;
// report call event to InfluxDB
if (m_network->m_enableInfluxDB) {
influxdb::QueryBuilder()
@ -403,6 +407,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
m_status.unlock();
m_network->m_totalCallsProcessed++;
m_network->m_totalActiveCalls++;
// is this a private call?
if (!group) {

@ -288,6 +288,10 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
LogInfoEx(LOG_MASTER, CALL_END_LOG);
}
m_network->m_totalActiveCalls--;
if (m_network->m_totalActiveCalls < 0)
m_network->m_totalActiveCalls = 0;
// report call event to InfluxDB
if (m_network->m_enableInfluxDB) {
influxdb::QueryBuilder()
@ -446,6 +450,7 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
m_status.unlock();
m_network->m_totalCallsProcessed++;
m_network->m_totalActiveCalls++;
// is this a private call?
if (lco == LCO::PRIVATE) {

@ -1827,6 +1827,8 @@ void RESTAPI::restAPI_GetStats(const HTTPPayload& request, HTTPPayload& reply, c
// total calls processed
uint32_t totalCallsProcessed = m_network->m_totalCallsProcessed;
response["totalCallsProcessed"].set<uint32_t>(totalCallsProcessed);
int32_t totalActiveCalls = m_network->m_totalActiveCalls;
response["totalActiveCalls"].set<int32_t>(totalActiveCalls);
// table totals
uint32_t ridTotalEntries = m_network->m_ridLookup->table().size();

Loading…
Cancel
Save

Powered by TurnKey Linux.