From: hadaq Date: Mon, 14 Jun 2010 14:38:07 +0000 (+0000) Subject: New output format: queues fill levels. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=555e1656d1d94f0c3b8ef2842ffcdd16e6679f09;p=daqdata.git New output format: queues fill levels. Sergey. --- diff --git a/hadaq/netmem.c b/hadaq/netmem.c index 52390af..a13de08 100644 --- a/hadaq/netmem.c +++ b/hadaq/netmem.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/netmem.c,v 6.37 2010-06-05 23:02:30 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/netmem.c,v 6.38 2010-06-14 14:38:07 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L @@ -270,6 +270,10 @@ static void add2Stat(TheArgs *theArgs, TheStats *my, float interval, ShmTrans ** dT = t - t_0; if (dT >= interval) { + + printf("\n"); + printf("%s ", "%"); + for (i = 0; i < theArgs->nrOfMsgs; i++) { buffSize = 2 * theArgs->queueSize[i]; queueSize = HadTuQueue_size(shmtr[i]->wrQueue); @@ -278,7 +282,7 @@ static void add2Stat(TheArgs *theArgs, TheStats *my, float interval, ShmTrans ** fillLevel = (unsigned long) (100 * queueSize + 0.5) / buffSize; (*my->netmemBuff[i]) = fillLevel; - /* printf("q[%02d]%5d\%\n",i,fillLevel); */ + printf("%3d", fillLevel); /* Add more statistic for recv bytes per second */ (*my->recvBytesRate[i]) = *nettr[i]->bytesReceived - lastBytesRecv[i]; @@ -286,6 +290,13 @@ static void add2Stat(TheArgs *theArgs, TheStats *my, float interval, ShmTrans ** } t_0 = t; + + printf("\n"); + printf("Q ", i, fillLevel); + for (i = 0; i < theArgs->nrOfMsgs; i++) { + printf("%3d", i); + } + printf("\n"); } } @@ -561,12 +572,10 @@ int main(int argc, char *argv[]) hadTu[i] = NULL; if (theArgs->queueSize[i] > 0) { - /* if the queueSize is given in CL */ - /* if( theArgs->queueSize[i] > 102400 + HadTu_hdrSize() ){ */ -/* hadTuSize[i] = 102400; */ -/* } */ -/* else */ - hadTuSize[i] = theArgs->queueSize[i] - HadTu_hdrSize(); + if (theArgs->queueSize[i] - HadTu_hdrSize() < 204800) + hadTuSize[i] = theArgs->queueSize[i] - HadTu_hdrSize(); + else + hadTuSize[i] = 204800; /*200kB */ } else { /* otherwise use variable queue size */ /* hadTuSize[i] = theArgs->varQSize[i] - HadTu_hdrSize(); */