ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [46/50] [abbrv] ignite git commit: io test
Date Mon, 10 Oct 2016 12:13:42 GMT
io test


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

Branch: refs/heads/ignite-gg-8-io2-selNow
Commit: 334fc8d8c20cc0292a59746f2b3eee3bd0a794e7
Parents: e3d3fb2
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Oct 6 13:47:15 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Oct 6 13:47:15 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java |  7 +++++--
 .../util/nio/GridSelectorNioSessionImpl.java    |  7 +++++--
 .../communication/tcp/TcpCommunicationSpi.java  |  4 ++++
 .../yardstick/IgniteBenchmarkUtilsTmp.java      |  2 +-
 .../cache/IgniteIoTestSendRandomBenchmark.java  | 21 ++++++++++++++++++++
 5 files changed, 36 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/334fc8d8/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 40ee4fe..4a96e56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -496,8 +496,11 @@ public class GridNioServer<T> {
                     throw new IgniteCheckedException(err);
             }
         }
-        else if (!ses.procWrite.get() && ses.procWrite.compareAndSet(false, true))
-            clientWorkers.get(ses.selectorIndex()).offer((SessionChangeRequest)fut);
+        else if (!ses.procWrite.get() && ses.procWrite.compareAndSet(false, true))
{
+            clientWorkers.get(ses.selectorIndex()).offer((SessionChangeRequest) fut);
+
+            ses.wakeupCnt.increment();
+        }
 
         if (msgQueueLsnr != null)
             msgQueueLsnr.apply(ses, msgCnt);

http://git-wip-us.apache.org/repos/asf/ignite/blob/334fc8d8/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
index 6dc53af..89f2773 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
@@ -29,13 +29,14 @@ import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentLinkedDeque8;
+import org.jsr166.LongAdder8;
 
 /**
  * Session implementation bound to selector API and socket API.
  * Note that this implementation requires non-null values for local and remote
  * socket addresses.
  */
-class GridSelectorNioSessionImpl extends GridNioSessionImpl {
+public class GridSelectorNioSessionImpl extends GridNioSessionImpl {
     /** Pending write requests. */
     private final ConcurrentLinkedDeque8<SessionWriteRequest> queue = new ConcurrentLinkedDeque8<>();
 
@@ -44,7 +45,7 @@ class GridSelectorNioSessionImpl extends GridNioSessionImpl {
     private SelectionKey key;
 
     /** Worker index for server */
-    private final int selectorIdx;
+    public final int selectorIdx;
 
     /** Semaphore. */
     @GridToStringExclude
@@ -71,6 +72,8 @@ class GridSelectorNioSessionImpl extends GridNioSessionImpl {
     /** */
     private Object sysMsg;
 
+    public final LongAdder8 wakeupCnt = new LongAdder8();
+
     /**
      * Creates session instance.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/334fc8d8/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 79eeb4f..66a5b7d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -1882,6 +1882,10 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         return super.getSpiContext();
     }
 
+    public GridNioServer server() {
+        return nioSrvr;
+    }
+
     /**
      * Recreates tpcSrvr socket instance.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/334fc8d8/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtilsTmp.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtilsTmp.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtilsTmp.java
index 7ca6c74..db89ded 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtilsTmp.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtilsTmp.java
@@ -46,7 +46,7 @@ public class IgniteBenchmarkUtilsTmp {
 
         final boolean clientDriverNode = true;
 
-        final int extraNodes = 4;
+        final int extraNodes = 6;
 
         final int warmUp = 30;
         final int duration = 60;

http://git-wip-us.apache.org/repos/asf/ignite/blob/334fc8d8/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestSendRandomBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestSendRandomBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestSendRandomBenchmark.java
index 5d08124..91b6149 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestSendRandomBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestSendRandomBenchmark.java
@@ -21,6 +21,10 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.managers.communication.IgniteIoTestMessage;
+import org.apache.ignite.internal.util.nio.GridNioServer;
+import org.apache.ignite.internal.util.nio.GridNioSession;
+import org.apache.ignite.internal.util.nio.GridSelectorNioSessionImpl;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
 import org.yardstickframework.BenchmarkConfiguration;
 import org.yardstickframework.BenchmarkUtils;
 
@@ -44,6 +48,10 @@ public class IgniteIoTestSendRandomBenchmark extends IgniteIoTestAbstractBenchma
             @Override
             public void run() {
                 try {
+                    TcpCommunicationSpi spi = (TcpCommunicationSpi)ignite.configuration().getCommunicationSpi();
+
+                    GridNioServer srv = spi.server();
+
                     Thread.sleep(30_000);
 
                     double cnt0 = 1;
@@ -92,6 +100,19 @@ public class IgniteIoTestSendRandomBenchmark extends IgniteIoTestAbstractBenchma
                                 resWriteReadSum0 / cnt0,
                                 resReadProcSum0 / cnt0));
 
+                        for (Object ses : srv.sessions()) {
+                            if (ses instanceof GridSelectorNioSessionImpl) {
+                                GridSelectorNioSessionImpl ses0 = (GridSelectorNioSessionImpl)ses;
+
+                                long wakeups = ses0.wakeupCnt.sumThenReset();
+
+                                BenchmarkUtils.println(cfg, "ses in=" + ses0.accepted() +
+                                    ", idx=" + ses0.selectorIdx +
+                                    ", addr=" + ses0.remoteAddress() +
+                                    ", wakeups=" + wakeups + ']');
+                            }
+                        }
+
                         cnt0 += 1;
                     }
                 } catch (InterruptedException e) {


Mime
View raw message