]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
New output format: queues fill levels. Sergey.
authorhadaq <hadaq>
Mon, 14 Jun 2010 14:38:07 +0000 (14:38 +0000)
committerhadaq <hadaq>
Mon, 14 Jun 2010 14:38:07 +0000 (14:38 +0000)
hadaq/netmem.c

index 52390af96946d9fbfbccede2f9fd194c30285e76..a13de089ee971bc123e6dd6b052c856149a9eaa9 100644 (file)
@@ -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(); */