mirror of
https://github.com/ntop/ntopng.git
synced 2026-06-02 07:03:13 +00:00
Adds alerted flows debug traces
This commit is contained in:
parent
0bbda384c9
commit
d4068bb48a
3 changed files with 37 additions and 4 deletions
|
|
@ -7752,6 +7752,39 @@ void NetworkInterface::nDPILoadHostnameCategory(char *what, ndpi_protocol_catego
|
|||
|
||||
/* *************************************** */
|
||||
|
||||
void NetworkInterface::incNumAlertedFlows(Flow *f) {
|
||||
num_active_alerted_flows++;
|
||||
|
||||
#ifdef ALERTED_FLOWS_DEBUG
|
||||
if(f) {
|
||||
char buf[256];
|
||||
ntop->getTrace()->traceEvent(TRACE_WARNING, "[inc][num_active_alerted_flows: %u][num_idle_alerted_flows: %u] %s",
|
||||
num_active_alerted_flows,
|
||||
num_idle_alerted_flows,
|
||||
f->print(buf, sizeof(buf)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* *************************************** */
|
||||
|
||||
void NetworkInterface::decNumAlertedFlows(Flow *f){
|
||||
num_idle_alerted_flows++;
|
||||
|
||||
#ifdef ALERTED_FLOWS_DEBUG
|
||||
if(f) {
|
||||
char buf[256];
|
||||
ntop->getTrace()->traceEvent(TRACE_WARNING, "[dec][num_active_alerted_flows: %u][num_idle_alerted_flows: %u] %s",
|
||||
num_active_alerted_flows,
|
||||
num_idle_alerted_flows,
|
||||
f->print(buf, sizeof(buf)));
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/* *************************************** */
|
||||
|
||||
u_int64_t NetworkInterface::getNumActiveAlertedFlows() const {
|
||||
if(num_active_alerted_flows >= num_idle_alerted_flows)
|
||||
return num_active_alerted_flows - num_idle_alerted_flows;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue