From 23dc8acafc3dd7a63df446c9712ca11394757cb4 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 26 Jun 2000 09:36:05 +0000 Subject: [PATCH] DW: - Added store swapin and swapout counters. - Changed the location of 'swap_files_cleaned' in StatCounters structure. --- src/fs/aufs/store_dir_aufs.cc | 4 ++-- src/fs/diskd/store_dir_diskd.cc | 4 ++-- src/fs/ufs/store_dir_ufs.cc | 4 ++-- src/stat.cc | 18 +++++++++++++----- src/store_swapin.cc | 3 ++- src/store_swapout.cc | 3 ++- src/structs.h | 8 ++++++-- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index dd96090c9d..70e8bf3d62 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.4 2000/06/08 18:05:37 hno Exp $ + * $Id: store_dir_aufs.cc,v 1.5 2000/06/26 03:36:13 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1177,7 +1177,7 @@ storeAufsDirClean(int swap_index) #else safeunlink(p2, 0); #endif - Counter.swap_files_cleaned++; + Counter.swap.files_cleaned++; } debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1); return k; diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index cd18992e23..e4314ae6d6 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.12 2000/06/21 07:32:13 wessels Exp $ + * $Id: store_dir_diskd.cc,v 1.13 2000/06/26 03:36:15 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1353,7 +1353,7 @@ storeDiskdDirClean(int swap_index) #else safeunlink(p2, 0); #endif - Counter.swap_files_cleaned++; + Counter.swap.files_cleaned++; } debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1); return k; diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index df51ca615e..afa340419c 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.5 2000/06/08 18:05:39 hno Exp $ + * $Id: store_dir_ufs.cc,v 1.6 2000/06/26 03:36:15 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1177,7 +1177,7 @@ storeUfsDirClean(int swap_index) #else safeunlink(p2, 0); #endif - Counter.swap_files_cleaned++; + Counter.swap.files_cleaned++; } debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1); return k; diff --git a/src/stat.cc b/src/stat.cc index 34ce9e0c99..66718f4db3 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.329 2000/06/26 01:38:37 wessels Exp $ + * $Id: stat.cc,v 1.330 2000/06/26 03:36:05 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -779,8 +779,12 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) : 0.0); x = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist); storeAppendPrintf(sentry, "median_select_fds = %f\n", x); - storeAppendPrintf(sentry, "swap_files_cleaned = %f/sec\n", - XAVG(swap_files_cleaned)); + storeAppendPrintf(sentry, "swap.outs = %f/sec\n", + XAVG(swap.outs)); + storeAppendPrintf(sentry, "swap.ins = %f/sec\n", + XAVG(swap.ins)); + storeAppendPrintf(sentry, "swap.files_cleaned = %f/sec\n", + XAVG(swap.files_cleaned)); storeAppendPrintf(sentry, "aborted_requests = %f/sec\n", XAVG(aborted_requests)); @@ -1156,8 +1160,12 @@ statCountersDump(StoreEntry * sentry) f->cputime); storeAppendPrintf(sentry, "wall_time = %f\n", tvSubDsec(f->timestamp, current_time)); - storeAppendPrintf(sentry, "swap_files_cleaned = %d\n", - f->swap_files_cleaned); + storeAppendPrintf(sentry, "swap.outs = %d\n", + f->swap.outs); + storeAppendPrintf(sentry, "swap.ins = %d\n", + f->swap.ins); + storeAppendPrintf(sentry, "swap.files_cleaned = %d\n", + f->swap.files_cleaned); storeAppendPrintf(sentry, "aborted_requests = %d\n", f->aborted_requests); } diff --git a/src/store_swapin.cc b/src/store_swapin.cc index 4a5817f0a2..1e7f6c3004 100644 --- a/src/store_swapin.cc +++ b/src/store_swapin.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapin.cc,v 1.24 2000/05/12 00:29:09 wessels Exp $ + * $Id: store_swapin.cc,v 1.25 2000/06/26 03:36:05 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapin Functions * AUTHOR: Duane Wessels @@ -80,6 +80,7 @@ storeSwapInFileClosed(void *data, int errflag, storeIOState * sio) sc->callback = NULL; callback(sc->callback_data, sc->copy_buf, errflag); } + Counter.swap.ins++; } static void diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 19d6cbf5c5..697f00b7be 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.cc,v 1.71 2000/06/25 22:28:43 wessels Exp $ + * $Id: store_swapout.cc,v 1.72 2000/06/26 03:36:06 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -303,6 +303,7 @@ storeSwapOutFileClosed(void *data, int errflag, storeIOState * sio) storeLog(STORE_LOG_SWAPOUT, e); storeDirSwapLog(e, SWAP_LOG_ADD); } + Counter.swap.outs++; } debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__); mem->swapout.sio = NULL; diff --git a/src/structs.h b/src/structs.h index 09ee833f19..04ef188eb9 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.342 2000/06/26 01:38:38 wessels Exp $ + * $Id: structs.h,v 1.343 2000/06/26 03:36:06 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1676,8 +1676,12 @@ struct _StatCounters { int selects; #endif } syscalls; - int swap_files_cleaned; int aborted_requests; + struct { + int files_cleaned; + int outs; + int ins; + } swap; }; /* per header statistics */ -- 2.47.3