1 | /* |
2 | |
3 | Derby - Class org.apache.derby.impl.services.cache.CacheStat |
4 | |
5 | Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.impl.services.cache; |
22 | |
23 | import org.apache.derby.iapi.services.sanity.SanityManager; |
24 | |
25 | class CacheStat { |
26 | |
27 | /* |
28 | ** Fields |
29 | */ |
30 | protected int findHit; |
31 | protected int findMiss; |
32 | protected int findFault; |
33 | protected int findCachedHit; |
34 | protected int findCachedMiss; |
35 | protected int create; |
36 | protected int ageOut; |
37 | protected int cleanAll; |
38 | protected int remove; |
39 | protected long initialSize; |
40 | protected long maxSize; |
41 | protected long currentSize; |
42 | |
43 | protected long[] data; |
44 | |
45 | public long[] getStats() |
46 | { |
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 | { |
70 | findHit = 0; |
71 | findMiss = 0; |
72 | findFault = 0; |
73 | findCachedHit = 0; |
74 | findCachedMiss = 0; |
75 | create = 0; |
76 | ageOut = 0; |
77 | cleanAll = 0; |
78 | remove = 0; |
79 | } |
80 | } |