/* statistics and rates counters */ #include #include #include /* getenv, exit */ #include #include #include #include #include "common.h" #include "message.h" #include "buffer.h" #include "stats.h" #include "netvar.h" void stats_init () { int scratchnetint; int sj; int i; extern int * StatsMem[NUMCOUNTERS]; extern int * RatesMem[NUMCOUNTERS]; readNetInt("MERGE_StatsTime", 0, 1, &scratchnetint); if (scratchnetint == 0) {assignNetInt("MERGE_StatsTime", 0, 1, 1);} /* default 1 sec */ readNetInt("MERGE_Stats", 0, 1, &scratchnetint); /* create Stats if needed */ for (i=1; i<(NUMCOUNTERS/MAXCOUNTERS); i++) { sprintf(message_buffer,"MERGE_Stats%d",i); readNetInt(message_buffer, 0, 1, &scratchnetint); } for(i=0;i