jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1189728 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/
Date Thu, 27 Oct 2011 12:58:34 GMT
Author: alexparvulescu
Date: Thu Oct 27 12:58:33 2011
New Revision: 1189728

URL: http://svn.apache.org/viewvc?rev=1189728&view=rev
Log:
JCR-3117 Stats for the PersistenceManager
 - rounding up some leftover stats

Modified:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/RepositoryStatisticsImpl.java

Modified: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java?rev=1189728&r1=1189727&r2=1189728&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java
(original)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java
Thu Oct 27 12:58:33 2011
@@ -25,12 +25,16 @@ public interface RepositoryStatistics {
 
     enum Type {
         BUNDLE_READ_COUNTER(true),
-        BUNDLE_READ_DURATION(true),
-        BUNDLE_READ_AVERAGE(false),
         BUNDLE_WRITE_COUNTER(true),
         BUNDLE_WRITE_DURATION(true),
         BUNDLE_WRITE_AVERAGE(false),
-        BUNDLE_CACHE_COUNTER(true),
+        BUNDLE_CACHE_ACCESS_COUNTER(true),
+        BUNDLE_CACHE_SIZE_COUNTER(true),
+        BUNDLE_CACHE_MISS_COUNTER(true),
+        BUNDLE_CACHE_MISS_DURATION(true),
+        BUNDLE_CACHE_MISS_AVERAGE(false),
+        BUNDLE_COUNTER(true),
+        BUNDLE_WS_SIZE_COUNTER(true),
         SESSION_READ_COUNTER(true),
         SESSION_READ_DURATION(true),
         SESSION_READ_AVERAGE(false),

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=1189728&r1=1189727&r2=1189728&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Thu Oct 27 12:58:33 2011
@@ -141,14 +141,21 @@ public abstract class AbstractBundlePers
     /** Counter of write operations. */
     private AtomicLong writeCounter;
 
-    /** Duration of read operations. */
-    private AtomicLong readDuration;
-
     /** Duration of write operations. */
     private AtomicLong writeDuration;
 
     /** Counter of bundle cache accesses. */
-    private AtomicLong cacheCounter;
+    private AtomicLong cacheAccessCounter;
+
+    /** Counter of bundle read operations. */
+    private AtomicLong cacheMissCounter;
+
+    /** Duration of bundle read operations. */
+    private AtomicLong cacheMissDuration;
+
+    
+    /** Counter of bundle cache size. */
+    private AtomicLong cacheSizeCounter;
 
     /**
      * Returns the size of the bundle cache in megabytes.
@@ -415,16 +422,20 @@ public abstract class AbstractBundlePers
 
         // statistics
         RepositoryStatisticsImpl stats = context.getRepositoryStatistics();
-        cacheCounter = stats.getCounter(
-                RepositoryStatistics.Type.BUNDLE_CACHE_COUNTER);
         readCounter = stats.getCounter(
                 RepositoryStatistics.Type.BUNDLE_READ_COUNTER);
-        readDuration = stats.getCounter(
-                RepositoryStatistics.Type.BUNDLE_READ_DURATION);
         writeCounter = stats.getCounter(
                 RepositoryStatistics.Type.BUNDLE_WRITE_COUNTER);
         writeDuration = stats.getCounter(
                 RepositoryStatistics.Type.BUNDLE_WRITE_DURATION);
+        cacheAccessCounter = stats.getCounter(
+                RepositoryStatistics.Type.BUNDLE_CACHE_ACCESS_COUNTER);
+        cacheSizeCounter = stats.getCounter(
+                RepositoryStatistics.Type.BUNDLE_CACHE_SIZE_COUNTER);
+        cacheMissCounter = stats.getCounter(
+                RepositoryStatistics.Type.BUNDLE_CACHE_MISS_COUNTER);
+        cacheMissDuration = stats.getCounter(
+                RepositoryStatistics.Type.BUNDLE_CACHE_MISS_DURATION);
     }
 
     /**
@@ -694,6 +705,7 @@ public abstract class AbstractBundlePers
      */
     private NodePropBundle getBundle(NodeId id) throws ItemStateException {
         NodePropBundle bundle = bundles.get(id);
+        readCounter.incrementAndGet();
         if (bundle == MISSING) {
             return null;
         }
@@ -719,9 +731,8 @@ public abstract class AbstractBundlePers
         long time = System.nanoTime();
         log.debug("Loading bundle {}", id);
         NodePropBundle bundle = loadBundle(id);
-        readDuration.addAndGet(System.nanoTime() - time);
-        readCounter.incrementAndGet();
-
+        cacheMissDuration.addAndGet(System.nanoTime() - time);
+        cacheMissCounter.incrementAndGet();
         if (bundle != null) {
             bundle.markOld();
             bundles.put(id, bundle, bundle.getSize());
@@ -784,7 +795,8 @@ public abstract class AbstractBundlePers
 
     public void cacheAccessed(long accessCount) {
         logCacheStats();
-        cacheCounter.addAndGet(accessCount);
+        cacheAccessCounter.addAndGet(accessCount);
+        cacheSizeCounter.set(bundles.getMemoryUsed());
     }
 
     private void logCacheStats() {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/RepositoryStatisticsImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/RepositoryStatisticsImpl.java?rev=1189728&r1=1189727&r2=1189728&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/RepositoryStatisticsImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/stats/RepositoryStatisticsImpl.java
Thu Oct 27 12:58:33 2011
@@ -50,9 +50,9 @@ public class RepositoryStatisticsImpl im
         TimeSeries swd = getOrCreateRecorder(Type.SESSION_WRITE_DURATION);
         avg.put(Type.SESSION_WRITE_AVERAGE, new TimeSeriesAverage(swd, swc));
 
-        TimeSeries brc = getOrCreateRecorder(Type.BUNDLE_READ_COUNTER);
-        TimeSeries brd = getOrCreateRecorder(Type.BUNDLE_READ_DURATION);
-        avg.put(Type.BUNDLE_READ_AVERAGE, new TimeSeriesAverage(brd, brc));
+        TimeSeries brc = getOrCreateRecorder(Type.BUNDLE_CACHE_MISS_COUNTER);
+        TimeSeries brd = getOrCreateRecorder(Type.BUNDLE_CACHE_MISS_DURATION);
+        avg.put(Type.BUNDLE_CACHE_MISS_AVERAGE, new TimeSeriesAverage(brd, brc));
 
         TimeSeries bwc = getOrCreateRecorder(Type.BUNDLE_WRITE_COUNTER);
         TimeSeries bwd = getOrCreateRecorder(Type.BUNDLE_WRITE_DURATION);



Mime
View raw message