jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1497723 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/jmx/CacheStatsMBean.java cache/CacheStats.java
Date Fri, 28 Jun 2013 10:49:48 GMT
Author: chetanm
Date: Fri Jun 28 10:49:48 2013
New Revision: 1497723

URL: http://svn.apache.org/r1497723
Log:
OAK-863 - Enable stats for various caches used in Oak by default

-- Renaming the resetCache -> resetStats

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheStats.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java?rev=1497723&r1=1497722&r2=1497723&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java
Fri Jun 28 10:49:48 2013
@@ -134,5 +134,5 @@ public interface CacheStatsMBean {
     /**
      * Reset the cache stats
      */
-    void resetCache();
+    void resetStats();
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheStats.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheStats.java?rev=1497723&r1=1497722&r2=1497723&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheStats.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheStats.java
Fri Jun 28 10:49:48 2013
@@ -31,7 +31,7 @@ public class CacheStats implements Cache
     private final Weigher weigher;
     private final long maxWeight;
     private final String name;
-    private com.google.common.cache.CacheStats statsSnapShot =
+    private com.google.common.cache.CacheStats lastSnapshot =
             new com.google.common.cache.CacheStats(0,0,0,0,0,0);
 
     public CacheStats(Cache cache, String name, Weigher weigher, long maxWeight) {
@@ -124,10 +124,10 @@ public class CacheStats implements Cache
     }
 
     @Override
-    public synchronized void resetCache(){
+    public synchronized void resetStats(){
         //Cache stats cannot be rest at Guava level. Instead we
         //take a snapshot and then subtract it from future stats calls
-        statsSnapShot = cache.stats();
+        lastSnapshot = cache.stats();
     }
 
     @Override
@@ -142,11 +142,11 @@ public class CacheStats implements Cache
                 .add("loadSuccessCount", getLoadSuccessCount())
                 .add("loadExceptionCount", getLoadExceptionCount())
                 .add("totalLoadTime", getTotalLoadTime())
-                .add("averageLoadPenalty", String.format("%1.2f",getAverageLoadPenalty()))
+                .add("averageLoadPenalty", String.format("%1.2f", getAverageLoadPenalty()))
                 .add("evictionCount", getEvictionCount())
                 .add("elementCount", getElementCount())
                 .add("totalWeight", humanReadableByteCount(estimateCurrentWeight(), true))
-                .add("maxWeight", humanReadableByteCount(getMaxTotalWeight(),true))
+                .add("maxWeight", humanReadableByteCount(getMaxTotalWeight(), true))
                 .toString();
     }
 
@@ -155,7 +155,7 @@ public class CacheStats implements Cache
     }
 
     private com.google.common.cache.CacheStats stats() {
-        return cache.stats().minus(statsSnapShot);
+        return cache.stats().minus(lastSnapshot);
     }
 
     /**



Mime
View raw message