relax transport error logging

This commit is contained in:
Andreas Öman 2007-08-30 15:18:00 +00:00
parent 3bb1102127
commit f50f824ea3
2 changed files with 43 additions and 4 deletions

View file

@ -413,14 +413,49 @@ transport_monitor(void *aux)
v = avgstat_read_and_expire(&t->tht_rate, dispatch_clock) * 8 / 1000 / 10;
if(v < 500) {
syslog(LOG_WARNING, "\"%s\" on \"%s\", very low bitrate: %d kb/s",
t->tht_channel->ch_name, t->tht_name, v);
switch(t->tht_rate_error_log_limiter) {
case 0:
syslog(LOG_WARNING, "\"%s\" on \"%s\", very low bitrate: %d kb/s",
t->tht_channel->ch_name, t->tht_name, v);
/* FALLTHRU */
case 1 ... 9:
t->tht_rate_error_log_limiter++;
break;
}
} else {
switch(t->tht_rate_error_log_limiter) {
case 0:
break;
case 1:
syslog(LOG_NOTICE, "\"%s\" on \"%s\", bitrate ok (%d kb/s)",
t->tht_channel->ch_name, t->tht_name, v);
/* FALLTHRU */
default:
t->tht_rate_error_log_limiter--;
}
}
v = avgstat_read(&t->tht_cc_errors, 10, dispatch_clock);
if(v > 1) {
syslog(LOG_WARNING, "\"%s\" on \"%s\", Excessive bit errors: %f errs/s",
if(v > t->tht_cc_error_log_limiter) {
t->tht_cc_error_log_limiter += v * 3;
syslog(LOG_WARNING, "\"%s\" on \"%s\", "
"%.2f continuity errors/s (10 sec average)",
t->tht_channel->ch_name, t->tht_name, (float)v / 10.);
} else if(v == 0) {
switch(t->tht_cc_error_log_limiter) {
case 0:
break;
case 1:
syslog(LOG_NOTICE, "\"%s\" on \"%s\", no continuity errors",
t->tht_channel->ch_name, t->tht_name);
/* FALLTHRU */
default:
t->tht_cc_error_log_limiter--;
}
}
}

View file

@ -265,6 +265,10 @@ typedef struct th_transport {
avgstat_t tht_rate;
int tht_monitor_suspend;
int tht_cc_error_log_limiter;
int tht_rate_error_log_limiter;
LIST_ENTRY(th_transport) tht_adapter_link;
LIST_ENTRY(th_transport) tht_channel_link;