Commit cf36c6d8 authored by luis_pereira87's avatar luis_pereira87

Improvements to reduce ITTI log message volume when queues full

parent d19302fb
...@@ -132,22 +132,19 @@ extern "C" { ...@@ -132,22 +132,19 @@ extern "C" {
int message_id = message->ittiMsgHeader.messageId; int message_id = message->ittiMsgHeader.messageId;
size_t s=t->message_queue.size(); size_t s=t->message_queue.size();
// to reduce the number of logs, we give a message each increase of 10% // to reduce the number of logs, we give a message each increase of 10%
if (s > t->last_log_size * 1.1 && s > t->admin.queue_size) { if ((s > t->last_log_size * 1.25) && (s > t->admin.queue_size / 10)) {
LOG_E(TMR, "Queue for %s task contains %ld messages\n", itti_get_task_name(destination_task_id), s); if (s > t->admin.queue_size) {
t->last_log_size = s; LOG_E(TMR, "Queue for %s task contains %ld messages\n", itti_get_task_name(destination_task_id), s);
} else {
} else if (s > t->last_log_size * 1.1 && s > t->admin.queue_size / 10) { LOG_I(ITTI,
LOG_I(ITTI, "Queue for %s task size: %ld (last message %s)\n",
"Queue for %s task size: %ld (last message %s)\n", itti_get_task_name(destination_task_id),
itti_get_task_name(destination_task_id), s + 1,
s + 1, ITTI_MSG_NAME(message));
ITTI_MSG_NAME(message)); }
t->last_log_size = s; t->last_log_size = s;
} } else if (t->last_log_size && s < t->admin.queue_size / 10) {
if (t->last_log_size && t->last_log_size < t->admin.queue_size / 10) {
// Inform when the queue decreases // Inform when the queue decreases
LOG_I(ITTI, "Queue for %s task size is back under 10%% of max size\n", itti_get_task_name(destination_task_id)); LOG_I(ITTI, "Queue for %s task size is back under 10%% of max size\n", itti_get_task_name(destination_task_id));
t->last_log_size = 0; t->last_log_size = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment