ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-3443 WIP
Date Fri, 08 Jul 2016 12:56:23 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3443 2dcbe38b7 -> 218c26767


IGNITE-3443 WIP


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/218c2676
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/218c2676
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/218c2676

Branch: refs/heads/ignite-3443
Commit: 218c26767a9f7a79815ec86619368f20dcb4b512
Parents: 2dcbe38
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Jul 8 19:56:23 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Jul 8 19:56:23 2016 +0700

----------------------------------------------------------------------
 .../ignite/cache/query/PerQueryMetrics.java     | 72 ++++++++++++++++++++
 .../query/GridCacheQueryMetricsAdapter.java     |  7 +-
 2 files changed, 78 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/218c2676/modules/core/src/main/java/org/apache/ignite/cache/query/PerQueryMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/PerQueryMetrics.java
b/modules/core/src/main/java/org/apache/ignite/cache/query/PerQueryMetrics.java
new file mode 100644
index 0000000..09f0f68
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/PerQueryMetrics.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.query;
+
+import java.io.Externalizable;
+import org.apache.ignite.internal.processors.cache.query.CacheQueryType;
+
+/**
+ * Per individual query metrics.
+ */
+public interface PerQueryMetrics {
+    /**
+     * TODO IGNITE-3443
+     * @return
+     */
+    public String query();
+
+    /**
+     *  TODO IGNITE-3443
+     * @return
+     */
+    public CacheQueryType queryType();
+
+    /**
+     * Gets minimum execution time of query.
+     *
+     * @return Minimum execution time of query.
+     */
+    public long minimumTime();
+
+    /**
+     * Gets maximum execution time of query.
+     *
+     * @return Maximum execution time of query.
+     */
+    public long maximumTime();
+
+    /**
+     * Gets average execution time of query.
+     *
+     * @return Average execution time of query.
+     */
+    public double averageTime();
+
+    /**
+     * Gets total number execution of query.
+     *
+     * @return Number of executions.
+     */
+    public int executions();
+
+    /**
+     * Gets total number of times a query execution failed.
+     *
+     * @return Total number of times a query execution failed.
+     */
+    public int fails();}

http://git-wip-us.apache.org/repos/asf/ignite/blob/218c2676/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryMetricsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryMetricsAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryMetricsAdapter.java
index 1928ea5..a3b9afe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryMetricsAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryMetricsAdapter.java
@@ -21,6 +21,8 @@ import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import org.apache.ignite.cache.query.QueryMetrics;
 import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -56,6 +58,9 @@ public class GridCacheQueryMetricsAdapter implements QueryMetrics, Externalizabl
     /** Number of fails. */
     private final LongAdder8 fails = new LongAdder8();
 
+    // TODO IGNITE-3443
+    private final Map<String, String> perQryMetrics = new ConcurrentHashMap<>(100);
+
     /** {@inheritDoc} */
     @Override public long minimumTime() {
         return minTime.get();
@@ -170,4 +175,4 @@ public class GridCacheQueryMetricsAdapter implements QueryMetrics, Externalizabl
     @Override public String toString() {
         return S.toString(GridCacheQueryMetricsAdapter.class, this);
     }
-}
\ No newline at end of file
+}


Mime
View raw message