ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/6] ignite git commit: Results printout for IO latency test
Date Tue, 23 May 2017 12:06:33 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5075 19ed098ee -> 7fc01683a


Results printout for IO latency test

(cherry picked from commit 096404d)


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

Branch: refs/heads/ignite-5075
Commit: 992c9767e3e5a1c6d1871cf54d4b901f96a7cb84
Parents: 64c5584
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri May 19 20:33:36 2017 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon May 22 11:13:58 2017 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 30 ++++++++++++++++++--
 1 file changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/992c9767/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 800f3cc..147f94d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -64,6 +64,7 @@ import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.platform.message.PlatformMessageFilter;
 import org.apache.ignite.internal.processors.pool.PoolProcessor;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
+import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.GridBoundedConcurrentLinkedHashSet;
 import org.apache.ignite.internal.util.StripedCompositeReadWriteLock;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -469,6 +470,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         final long sleepDuration = 5000;
         final byte[] payLoad = new byte[payLoadSize];
         final Map<UUID, long[]>[] res = new Map[threads];
+        final ConcurrentMap<UUID, GridAtomicLong> maxLatencies = new ConcurrentHashMap8<>();
 
         boolean failed = true;
 
@@ -542,7 +544,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                             }
                         }
 
-                        printIoTestResults(maxLatency / (1000 * rangesCnt), res0);
+                        printIoTestResults(maxLatency / (1000 * rangesCnt), res0, maxLatencies);
                     }
                     catch (InterruptedException | BrokenBarrierException e) {
                         U.error(log, "IO test failed.", e);
@@ -593,8 +595,21 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                                 if (latencies == null)
                                     res0.put(node.id(), latencies = new long[rangesCnt +
1]);
 
-                                if (latency >= maxLatency)
+                                if (latency >= maxLatency) {
                                     latencies[rangesCnt]++; // Timed out.
+
+                                    GridAtomicLong maxLatency = maxLatencies.get(node.id());
+
+                                    if (maxLatency == null) {
+                                        GridAtomicLong old = maxLatencies.putIfAbsent(node.id(),
+                                            maxLatency = new GridAtomicLong());
+
+                                        if (old != null)
+                                            maxLatency = old;
+                                    }
+
+                                    maxLatency.setIfGreater(latency);
+                                }
                                 else {
                                     int idx = (int)Math.floor((1.0 * latency) / ((1.0 * maxLatency)
/ rangesCnt));
 
@@ -628,8 +643,13 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
     /**
      * @param binLatencyMcs Bin latency in microseconds.
      * @param res Resulting map.
+     * @param maxLatencies Max latency for each node.
      */
-    private void printIoTestResults(long binLatencyMcs, Map<UUID, long[]> res) {
+    private void printIoTestResults(
+        long binLatencyMcs,
+        Map<UUID, long[]> res,
+        ConcurrentMap<UUID, GridAtomicLong> maxLatencies
+    ) {
         StringBuilder b = new StringBuilder(U.nl())
             .append("IO test results (round-trip count per each latency bin) " +
                 "[binLatency=" + binLatencyMcs + "mcs]")
@@ -667,6 +687,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                         nodeRes[i], (100.0 * nodeRes[i]) / sum,
                         curSum, (100.0 * curSum) / sum));
             }
+
+            GridAtomicLong maxLatency = maxLatencies.get(e.getKey());
+
+            b.append("Max latency (ns): ").append(maxLatency != null ? maxLatency.get() :
-1).append(U.nl());
         }
 
         if (log.isInfoEnabled())


Mime
View raw message