openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r935035 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
Date Fri, 16 Apr 2010 18:32:33 GMT
Author: ppoddar
Date: Fri Apr 16 18:32:32 2010
New Revision: 935035

URL: http://svn.apache.org/viewvc?rev=935035&view=rev
Log:
OPENJPA-703: Remove sync on stats

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java?rev=935035&r1=935034&r2=935035&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
Fri Apr 16 18:32:32 2010
@@ -123,7 +123,8 @@ public interface QueryStatistics<T> exte
 	 * A default implementation.
 	 * 
 	 * Maintains statistics for only a fixed number of queries.
-	 *
+	 * Statistical counts are approximate and not exact (to keep thread synchorization overhead
low).
+	 * 
 	 */
 	public static class Default<T> implements QueryStatistics<T> {
 	    private static final int FIXED_SIZE = 1000;
@@ -222,7 +223,7 @@ public interface QueryStatistics<T> exte
 			target.put(query, row);
 		}
 		
-		public synchronized void recordExecution(T query) {
+		public void recordExecution(T query) {
 		    if (query == null)
 		        return;
 		    boolean cached = astats.containsKey(query);
@@ -267,4 +268,4 @@ public interface QueryStatistics<T> exte
             return row[READ] + ":" + row[HIT] + "(" + pct(row[HIT], row[READ]) + "%)";
 		}
 	}
-}
+}
\ No newline at end of file



Mime
View raw message