]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-fs-busy-stats-20050113
authorDerrick Brashear <shadow@dementia.org>
Mon, 31 Jan 2005 04:14:45 +0000 (04:14 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 31 Jan 2005 04:14:45 +0000 (04:14 +0000)
add support for counting number of vbusies returned

(cherry picked from commit d9e55baca180891ef999919118a5ad2d73764abb)

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

index 27adda19fc0f8670528f1131b69beca100163bbb..19b14fb8936a0a5f2772ae1b2088574606d593ab 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 e34ff3ecf007bbb20ffc553e7484d776e021fcec..03c035e32326f9034759eb5e7cb092a6fb8567fa 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 ac8fe9f73deb9f30dd6b5113edf3ba7666b848a3..4ce6a699505ee1edead4d8a562d9c22ff56cdb22 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 fe13b539f741f1cfd95e3b39cc5889ab471039c6..1e0309e0361127521d635a87dc727a8b33787e64 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 cd57a4d4cdf47f3239e99521c68a03f2771cb065..a1b490eccbae368ff2368077174cc016c522a9d9 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.
      */