From: adrian <> Date: Mon, 13 Aug 2001 04:18:35 +0000 (+0000) Subject: * return the load based on the aio queue depth X-Git-Tag: SQUID_3_0_PRE1~1444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dbabb56eb90e2b10ef08f517bab89bff8f970b6;p=thirdparty%2Fsquid.git * return the load based on the aio queue depth * add a statistic line showing the number of pending disk operations --- diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 7eb8d97a38..2647e090b9 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -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");