From: xchaos Date: Tue, 29 Nov 2011 13:24:01 +0000 (+0000) Subject: monitoring počtu překročení FUP, a pokus o HTML validaci X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=78884bad50568440ce643e5155b60fda9aa30262;p=svn%2FPrometheus-QoS%2F.git monitoring počtu překročení FUP, a pokus o HTML validaci git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@153 251d49ef-1d17-4917-a970-b30cf55b089b --- diff --git a/prometheus.c b/prometheus.c index 5420588..4731bcc 100644 --- a/prometheus.c +++ b/prometheus.c @@ -1525,7 +1525,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); for_each(keyword,keywords) { - fprintf(f,"%d M",keyword->html_color,group->min*keyword->data_limit); + fprintf(f,"%d M",keyword->html_color,group->min*keyword->data_limit); } i+=group->desired; total+=group->count; @@ -1557,6 +1557,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); int colspan; FILE *iplog; struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL; + int limit_count=0, prio_count=0; colspan=11; if(qos_proxy) @@ -1594,13 +1595,15 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); char *f1="", *f2=""; if(ip->maxdesired) { - f1=""; - f2=""; + f1=""; + f2=""; + limit_count++; } else if(ip->prio>highest_priority+1) { - f1=""; - f2=""; + f1=""; + f2=""; + prio_count++; } #ifdef DEBUG @@ -1622,7 +1625,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); fputs("\n",f); } fprintf(f,"%Lu M\n", ip->credit); - fprintf(f,"%Lu M", + fprintf(f,"%Lu M", ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); fprintf(f,"%s%Lu M%s%Lu M\n", f1, ip->traffic, f2, ip->direct); if(qos_proxy) @@ -1668,7 +1671,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); fprintf(f,"%Lu M\n", total_proxy); } fprintf(f,"%Lu M", total_upload); - fputs("\n\n",f); + fprintf(f,"FUP-LIMIT %dx LOW-PRIO %dx\n\n",limit_count,prio_count); if(active_classes>10) { @@ -1743,8 +1746,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); iplog=fopen(str,"a"); if(iplog) { - fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\t%d\t%Lu M\t%d\t%s", - time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, active_classes, total_traffic, total, d); /* d = date*/ + fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\tACTIVE %d\tTRAFFIC %Lu M\tCLASSES %d\tFUP-LIMIT %d\tLOW-PRIO %d\t%s", + time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, + active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/ fclose(iplog); } }