fs-busy-stats-20050113
authorDerrick Brashear <shadow@dementia.org>
Fri, 14 Jan 2005 03:03:27 +0000 (03:03 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 14 Jan 2005 03:03:27 +0000 (03:03 +0000)
add support for counting number of vbusies returned

src/rx/rx.c
src/rx/rx.h
src/viced/afsfileprocs.c
src/viced/fs_stats.h
src/xstat/xstat_fs_test.c

index 27adda1..19b14fb 100644 (file)
@@ -2673,6 +2673,9 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket,
                MUTEX_ENTER(&conn->conn_data_lock);
                conn->refCount--;
                MUTEX_EXIT(&conn->conn_data_lock);
+               MUTEX_ENTER(&rx_stats_mutex);
+               rx_stats.nBusies++;
+               MUTEX_EXIT(&rx_stats_mutex);
                return tp;
            }
            rxi_KeepAliveOn(call);
index e34ff3e..03c035e 100644 (file)
@@ -804,7 +804,8 @@ struct rx_stats {           /* General rx statistics */
     int ignorePacketDally;     /* packets dropped because call is in dally state */
     int receiveCbufPktAllocFailures;
     int sendCbufPktAllocFailures;
-    int spares[5];
+    int nBusies;
+    int spares[4];
 };
 
 /* structures for debug input and output packets */
index ac8fe9f..4ce6a69 100644 (file)
@@ -483,11 +483,21 @@ CheckVnode(AFSFid * fid, Volume ** volptr, Vnode ** vptr, int lock)
                    /* I'm not really worried about when we restarted, I'm   */
                    /* just worried about when the first VBUSY was returned. */
                    TM_GetTimeOfDay(&restartedat, 0);
+                   if (busyonrst) {
+                       FS_LOCK;
+                       afs_perfstats.fs_nBusies++;
+                       FS_UNLOCK;
+                   }
                    return (busyonrst ? VBUSY : VRESTARTING);
                } else {
                    struct timeval now;
                    TM_GetTimeOfDay(&now, 0);
                    if ((now.tv_sec - restartedat.tv_sec) < (11 * 60)) {
+                       if (busyonrst) {
+                           FS_LOCK;
+                           afs_perfstats.fs_nBusies++;
+                           FS_UNLOCK;
+                       }
                        return (busyonrst ? VBUSY : VRESTARTING);
                    } else {
                        return (VRESTARTING);
@@ -5640,7 +5650,8 @@ FillPerfValues(struct afs_PerfStats *a_perfP)
     a_perfP->host_ClientBlocks = CEBlocks;
 
     a_perfP->sysname_ID = afs_perfstats.sysname_ID;
-
+    a_perfP->rx_nBusies = (afs_int32) rx_stats.nBusies;
+    a_perfP->fs_nBusies = afs_perfstats.fs_nBusies;
 }                              /*FillPerfValues */
 
 
index fe13b53..1e0309e 100644 (file)
@@ -123,10 +123,13 @@ struct afs_PerfStats {
      */
     afs_int32 sysname_ID;      /*Unique hardware/OS identifier */
 
+    afs_int32 rx_nBusies;      /*Ttl VBUSYs sent to shed load */
+    afs_int32 fs_nBusies;      /*Ttl VBUSYs sent during restart/vol clone */
+
     /*
      * Spares
      */
-    afs_int32 spare[31];
+    afs_int32 spare[29];
 };
 
 #if FS_STATS_DETAILED
index cd57a4d..a1b490e 100644 (file)
@@ -246,8 +246,10 @@ PrintOverallPerfInfo(struct afs_PerfStats *a_ovP)
     printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns);
     printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs);
     printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs);
-    printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs);
+    printf("\t%10d rx_nFreeCallStructs\n", a_ovP->rx_nFreeCallStructs);
+    printf("\t%10d rx_nBusies\n\n", a_ovP->rx_nBusies);
 
+    printf("\t%10d fs_nBusies\n\n", a_ovP->fs_nBusies);
     /*
      * Host module fields.
      */