jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1565137 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/ jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/ jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/
Date Thu, 06 Feb 2014 09:55:50 GMT
Author: mduerig
Date: Thu Feb  6 09:55:50 2014
New Revision: 1565137

URL: http://svn.apache.org/r1565137
Log:
JCR-3723: Add support for observation statistics to RepositoryStatistics

Modified:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/stats/RepositoryStatistics.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/RepositoryStatisticsImpl.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/RepositoryStatisticsImplTest.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=1565137&r1=1565136&r2=1565137&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 Feb  6 09:55:50 2014
@@ -23,6 +23,11 @@ package org.apache.jackrabbit.api.stats;
  */
 public interface RepositoryStatistics {
 
+    /**
+     * The values of this enum determine the type of the time
+     * series returned by {@link #getTimeSeries(Type)}
+     * and link {@link #getTimeSeries(String, boolean)}.
+     */
     enum Type {
         BUNDLE_READ_COUNTER(true),
         BUNDLE_WRITE_COUNTER(true),
@@ -35,17 +40,87 @@ public interface RepositoryStatistics {
         BUNDLE_CACHE_MISS_AVERAGE(false),
         BUNDLE_COUNTER(true),
         BUNDLE_WS_SIZE_COUNTER(true),
+
+        /**
+         * Number of read accesses through any session.
+         */
         SESSION_READ_COUNTER(true),
+
+        /**
+         * Total time spent reading from sessions in nano seconds.
+         */
         SESSION_READ_DURATION(true),
+
+        /**
+         * Average time spent reading from sessions in nano seconds.
+         * This is the sum of all read durations divided by the number
+         * of reads in the respective time period.
+         */
         SESSION_READ_AVERAGE(false),
+
+        /**
+         * Number of write accesses through any session.
+         */
         SESSION_WRITE_COUNTER(true),
+
+        /**
+         * Total time spent writing to sessions in nano seconds.
+         */
         SESSION_WRITE_DURATION(true),
+
+        /**
+         * Average time spent writing to sessions in nano seconds.
+         * This is the sum of all write durations divided by the number
+         * of writes in the respective time period.
+         */
         SESSION_WRITE_AVERAGE(false),
+
+        /**
+         * Number of calls sessions that have been logged in.
+         */
         SESSION_LOGIN_COUNTER(true),
+
+        /**
+         * Number of currently logged in sessions.
+         */
         SESSION_COUNT(false),
+
+        /**
+         * Number of queries executed.
+         */
         QUERY_COUNT(true),
+
+        /**
+         * Total time spent evaluating queries in milli seconds.
+         */
         QUERY_DURATION(true),
-        QUERY_AVERAGE(true);
+
+        /**
+         * Average time spent evaluating queries in milli seconds.
+         * This is the sum of all query durations divided by the number
+         * of queries in the respective time period.
+         */
+        QUERY_AVERAGE(true),
+
+        /**
+         * Total number of observation {@code Event} instances delivered
+         * to all observation listeners.
+         */
+        OBSERVATION_EVENT_COUNTER(true),
+
+        /**
+         * Total time spent processing observation events by all observation
+         * listeners in nano seconds.
+         */
+        OBSERVATION_EVENT_DURATION(true),
+
+        /**
+         * Average time spent processing observation events by all observation
+         * listeners in nano seconds.
+         * This is the sum of all observation durations divided by the number
+         * of observation events in the respective time period.
+         */
+        OBSERVATION_EVENT_AVERAGE(true);
 
         private final boolean resetValueEachSecond;
 
@@ -56,8 +131,8 @@ public interface RepositoryStatistics {
         public static Type getType(String type) {
             Type realType = null;
             try {
-                realType = Type.valueOf(type);
-            } catch (IllegalArgumentException ignore) {};
+                realType = valueOf(type);
+            } catch (IllegalArgumentException ignore) {}
             return realType;
         }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/RepositoryStatisticsImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/RepositoryStatisticsImpl.java?rev=1565137&r1=1565136&r2=1565137&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/RepositoryStatisticsImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/RepositoryStatisticsImpl.java
Thu Feb  6 09:55:50 2014
@@ -49,8 +49,10 @@ public class RepositoryStatisticsImpl im
                 Type.BUNDLE_CACHE_MISS_DURATION, Type.BUNDLE_CACHE_MISS_AVERAGE);
         createAvg(Type.BUNDLE_WRITE_COUNTER, Type.BUNDLE_WRITE_DURATION,
                 Type.BUNDLE_WRITE_AVERAGE);
-        createAvg(Type.QUERY_COUNT, Type.QUERY_DURATION, Type.QUERY_AVERAGE);
-
+        createAvg(Type.QUERY_COUNT, Type.QUERY_DURATION,
+                Type.QUERY_AVERAGE);
+        createAvg(Type.OBSERVATION_EVENT_COUNTER, Type.OBSERVATION_EVENT_DURATION,
+                Type.OBSERVATION_EVENT_AVERAGE);
     }
 
     private void createAvg(Type count, Type duration, Type avgTs) {

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/RepositoryStatisticsImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/RepositoryStatisticsImplTest.java?rev=1565137&r1=1565136&r2=1565137&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/RepositoryStatisticsImplTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/stats/RepositoryStatisticsImplTest.java
Thu Feb  6 09:55:50 2014
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.api.stats.T
 
 public class RepositoryStatisticsImplTest extends TestCase {
 
-    private static final int DEFAULT_NUMBER_OF_ELEMENTS = 17;
+    private static final int DEFAULT_NUMBER_OF_ELEMENTS = 20;
 
     public void testDefaultIterator() {
         RepositoryStatisticsImpl repositoryStatistics = new RepositoryStatisticsImpl();



Mime
View raw message