]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
* return the load based on the aio queue depth
authoradrian <>
Mon, 13 Aug 2001 04:18:35 +0000 (04:18 +0000)
committeradrian <>
Mon, 13 Aug 2001 04:18:35 +0000 (04:18 +0000)
* add a statistic line showing the number of pending disk operations

src/fs/coss/store_dir_coss.cc

index 7eb8d97a385498b1155ab571efa716bd3154ebb3..2647e090b9ac571f9d556615f3dcb687ed2d9549 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.27 2001/08/12 10:25:00 adrian Exp $
+ * $Id: store_dir_coss.cc,v 1.28 2001/08/12 22:18:35 adrian Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -680,13 +680,17 @@ storeCossDirShutdown(SwapDir * SD)
 int
 storeCossDirCheckObj(SwapDir * SD, const StoreEntry * e)
 {
+    CossInfo *cs = (CossInfo *) SD->fsdata;
+    int loadav;
+
     /* Check if the object is a special object, we can't cache these */
     if (EBIT_TEST(e->flags, ENTRY_SPECIAL))
        return -1;
 
     /* Otherwise, we're ok */
-    /* Return 900 (90%) load */
-    return 900;
+    /* Return load, cs->aq.aq_numpending out of MAX_ASYNCOP */
+    loadav = cs->aq.aq_numpending * 1000 / MAX_ASYNCOP;
+    return loadav;
 }
 
 
@@ -720,6 +724,7 @@ storeCossDirStats(SwapDir * SD, StoreEntry * sentry)
        SD->map->n_files_in_map, SD->map->max_n_files,
        percent(SD->map->n_files_in_map, SD->map->max_n_files));
 #endif
+    storeAppendPrintf(sentry, "Pending operations: %d out of %d\n", cs->aq.aq_numpending, MAX_ASYNCOP);
     storeAppendPrintf(sentry, "Flags:");
     if (SD->flags.selected)
        storeAppendPrintf(sentry, " SELECTED");