Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / impl / services / cache / CacheStat.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/impl/services/cache/CacheStat.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/impl/services/cache/CacheStat.java
new file mode 100644 (file)
index 0000000..e3b7880
--- /dev/null
@@ -0,0 +1,81 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.impl.services.cache.CacheStat\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.impl.services.cache;\r
+\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+\r
+class CacheStat {\r
+\r
+       /*\r
+       ** Fields\r
+       */\r
+       protected int findHit;\r
+       protected int findMiss;\r
+       protected int findFault;\r
+       protected int findCachedHit;\r
+       protected int findCachedMiss;\r
+       protected int create;\r
+       protected int ageOut;\r
+       protected int cleanAll;\r
+       protected int remove;\r
+       protected long initialSize;\r
+       protected long maxSize;\r
+       protected long currentSize;\r
+\r
+       protected long[] data;\r
+\r
+       public long[] getStats() \r
+       {\r
+               if (data == null)\r
+                       data = new long[14];\r
+\r
+               data[0] = findHit + findMiss;\r
+               data[1] = findHit;\r
+               data[2] = findMiss;\r
+               data[3] = findFault;\r
+               data[4] = findCachedHit + findCachedMiss;\r
+               data[5] = findCachedHit;\r
+               data[6] = findCachedMiss;\r
+               data[7] = create;\r
+               data[8] = ageOut;\r
+               data[9] = cleanAll;\r
+               data[10] = remove;\r
+               data[11] = initialSize;\r
+               data[12] = maxSize;\r
+               data[13] = currentSize;\r
+\r
+               return data;\r
+       }\r
+\r
+       public void reset()\r
+       {\r
+               findHit = 0;\r
+               findMiss = 0;\r
+               findFault = 0;\r
+               findCachedHit = 0;\r
+               findCachedMiss = 0;\r
+               create = 0;\r
+               ageOut = 0;\r
+               cleanAll = 0;\r
+               remove = 0;\r
+       }\r
+}\r