geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject geode git commit: GEODE-2403: Increment query executed stats before lastResult
Date Tue, 07 Feb 2017 18:42:40 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 5efe89b90 -> 80f8c26e1


GEODE-2403: Increment query executed stats before lastResult

	* The stat for number of queries executed is now incremented before the lastResult call.
	* Before, this was called in the finally block. This resulted in the increment even if there
was a exception.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/80f8c26e
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/80f8c26e
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/80f8c26e

Branch: refs/heads/develop
Commit: 80f8c26e13c0db8251e9384d58cc1e6a13b83e1b
Parents: 5efe89b
Author: nabarun <nnag@pivotal.io>
Authored: Tue Feb 7 10:02:17 2017 -0800
Committer: nabarun <nnag@pivotal.io>
Committed: Tue Feb 7 10:22:56 2017 -0800

----------------------------------------------------------------------
 .../apache/geode/cache/lucene/internal/LuceneIndexStats.java    | 5 ++++-
 .../geode/cache/lucene/internal/distributed/LuceneFunction.java | 1 +
 .../geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java  | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/80f8c26e/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
index a914799..6c35d5c9 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
@@ -138,7 +138,6 @@ public class LuceneIndexStats {
   public void endQuery(long start, final int totalHits) {
     stats.incLong(queryExecutionTimeId, getStatTime() - start);
     stats.incInt(queryExecutionsInProgressId, -1);
-    stats.incInt(queryExecutionsId, 1);
     stats.incLong(queryExecutionTotalHitsId, totalHits);
   }
 
@@ -235,4 +234,8 @@ public class LuceneIndexStats {
   public Statistics getStats() {
     return this.stats;
   }
+
+  public void incNumberOfQueryExecuted() {
+    stats.incInt(queryExecutionsId, 1);
+  }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/80f8c26e/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
index fd908de..9d45526 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
@@ -116,6 +116,7 @@ public class LuceneFunction implements Function, InternalEntity {
       } finally {
         stats.endQuery(start, mergedResult == null ? 0 : mergedResult.size());
       }
+      stats.incNumberOfQueryExecuted();
       resultSender.lastResult(mergedResult);
     } catch (IOException | BucketNotFoundException e) {
       logger.warn("", e);

http://git-wip-us.apache.org/repos/asf/geode/blob/80f8c26e/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
index f9e200a..215edb4 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
@@ -55,6 +55,7 @@ public class LuceneIndexStatsJUnitTest {
     stats.startQuery();
     verifyIncInt("queryExecutionsInProgress", 1);
     stats.endQuery(5, 2);
+    stats.incNumberOfQueryExecuted();
     verifyIncInt("queryExecutionsInProgress", -1);
     verifyIncInt("queryExecutions", 1);
     verifyIncLong("queryExecutionTotalHits", 2);


Mime
View raw message