01: /*
02:
03: Derby - Class org.apache.derby.impl.services.cache.CacheStat
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.impl.services.cache;
23:
24: import org.apache.derby.iapi.services.sanity.SanityManager;
25:
26: class CacheStat {
27:
28: /*
29: ** Fields
30: */
31: protected int findHit;
32: protected int findMiss;
33: protected int findFault;
34: protected int findCachedHit;
35: protected int findCachedMiss;
36: protected int create;
37: protected int ageOut;
38: protected int cleanAll;
39: protected int remove;
40: protected long initialSize;
41: protected long maxSize;
42: protected long currentSize;
43:
44: protected long[] data;
45:
46: public long[] getStats() {
47: if (data == null)
48: data = new long[14];
49:
50: data[0] = findHit + findMiss;
51: data[1] = findHit;
52: data[2] = findMiss;
53: data[3] = findFault;
54: data[4] = findCachedHit + findCachedMiss;
55: data[5] = findCachedHit;
56: data[6] = findCachedMiss;
57: data[7] = create;
58: data[8] = ageOut;
59: data[9] = cleanAll;
60: data[10] = remove;
61: data[11] = initialSize;
62: data[12] = maxSize;
63: data[13] = currentSize;
64:
65: return data;
66: }
67:
68: public void reset() {
69: findHit = 0;
70: findMiss = 0;
71: findFault = 0;
72: findCachedHit = 0;
73: findCachedMiss = 0;
74: create = 0;
75: ageOut = 0;
76: cleanAll = 0;
77: remove = 0;
78: }
79: }
|