Adds extra timing info for flow periodicHTStateUpdate

This commit is contained in:
Simone Mainardi 2019-10-31 12:40:24 +01:00
parent 4f3a6dab85
commit 8db49f7268
2 changed files with 10 additions and 2 deletions

View file

@ -2881,6 +2881,7 @@ void NetworkInterface::periodicHTStateUpdate(time_t deadline, lua_State* vm) {
hasSeenVlanTaggedPackets() ? vlans_hash : NULL,
macs_hash
};
time_t update_end;
periodicUpdateInitTime(&tv);
periodic_ht_state_update_user_data.acle = NULL,
@ -2903,8 +2904,14 @@ void NetworkInterface::periodicHTStateUpdate(time_t deadline, lua_State* vm) {
}
}
if(time(NULL) > deadline)
ntop->getTrace()->traceEvent(TRACE_ERROR, "Deadline exceeded [%s][%s]", __FUNCTION__, get_name());
if((update_end = time(NULL)) > deadline) {
char date_buf[32];
struct tm deadline_tm;
strftime(date_buf, sizeof(date_buf), "%H:%M:%S", localtime_r(&deadline, &deadline_tm));
ntop->getTrace()->traceEvent(TRACE_ERROR, "Deadline exceeded [%s][%s][expected: %s][off by: %u secs]",
__FUNCTION__, get_name(), date_buf, update_end - deadline);
}
}
/* **************************************************** */