]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/coss/StoreFScoss.cc
3 * $Id: StoreFScoss.cc,v 1.2 2003/08/27 21:19:38 wessels Exp $
5 * DEBUG: section 47 Store Directory Routines
6 * AUTHOR: Robert Collins
8 * SQUID Web Proxy Cache http://www.squid-cache.org/
9 * ----------------------------------------------------------
11 * Squid is the result of efforts by numerous individuals from
12 * the Internet community; see the CONTRIBUTORS file for full
13 * details. Many organizations have provided support for Squid's
14 * development; see the SPONSORS file for full details. Squid is
15 * Copyrighted (C) 2001 by the Regents of the University of
16 * California; see the COPYRIGHT file for full details. Squid
17 * incorporates software developed and/or copyrighted by other
18 * sources; see the CREDITS file for full details.
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
37 #include "StoreFileSystem.h"
38 #include "fs/coss/StoreFScoss.h"
39 #include "store_coss.h"
42 struct _coss_stats coss_stats
;
44 static void storeCossStats(StoreEntry
*);
46 StoreFScoss
StoreFScoss::_instance
;
49 StoreFScoss::GetInstance()
54 StoreFScoss::StoreFScoss()
60 StoreFScoss::type() const
68 /* memPoolDestroy(&coss_index_pool); XXX Should be here? */
69 cachemgrRegister("coss", "COSS Stats", storeCossStats
, 0, 1);
74 StoreFScoss::createSwapDir()
76 SwapDir
*result
= new CossSwapDir
;
86 coss_index_pool
= memPoolCreate("COSS index data", sizeof(CossIndexNode
));
91 storeCossStats(StoreEntry
* sentry
)
93 const char *tbl_fmt
= "%10s %10d %10d %10d\n";
94 storeAppendPrintf(sentry
, "\n OPS SUCCESS FAIL\n");
95 storeAppendPrintf(sentry
, tbl_fmt
,
96 "open", coss_stats
.open
.ops
, coss_stats
.open
.success
, coss_stats
.open
.fail
);
97 storeAppendPrintf(sentry
, tbl_fmt
,
98 "create", coss_stats
.create
.ops
, coss_stats
.create
.success
, coss_stats
.create
.fail
);
99 storeAppendPrintf(sentry
, tbl_fmt
,
100 "close", coss_stats
.close
.ops
, coss_stats
.close
.success
, coss_stats
.close
.fail
);
101 storeAppendPrintf(sentry
, tbl_fmt
,
102 "unlink", coss_stats
.unlink
.ops
, coss_stats
.unlink
.success
, coss_stats
.unlink
.fail
);
103 storeAppendPrintf(sentry
, tbl_fmt
,
104 "read", coss_stats
.read
.ops
, coss_stats
.read
.success
, coss_stats
.read
.fail
);
105 storeAppendPrintf(sentry
, tbl_fmt
,
106 "write", coss_stats
.write
.ops
, coss_stats
.write
.success
, coss_stats
.write
.fail
);
107 storeAppendPrintf(sentry
, tbl_fmt
,
108 "s_write", coss_stats
.stripe_write
.ops
, coss_stats
.stripe_write
.success
, coss_stats
.stripe_write
.fail
);
110 storeAppendPrintf(sentry
, "\n");
111 storeAppendPrintf(sentry
, "stripes: %d\n", coss_stats
.stripes
);
112 storeAppendPrintf(sentry
, "alloc.alloc: %d\n", coss_stats
.alloc
.alloc
);
113 storeAppendPrintf(sentry
, "alloc.realloc: %d\n", coss_stats
.alloc
.realloc
);
114 storeAppendPrintf(sentry
, "alloc.collisions: %d\n", coss_stats
.alloc
.collisions
);
115 storeAppendPrintf(sentry
, "disk_overflows: %d\n", coss_stats
.disk_overflows
);
116 storeAppendPrintf(sentry
, "stripe_overflows: %d\n", coss_stats
.stripe_overflows
);
117 storeAppendPrintf(sentry
, "open_mem_hits: %d\n", coss_stats
.open_mem_hits
);
118 storeAppendPrintf(sentry
, "open_mem_misses: %d\n", coss_stats
.open_mem_misses
);