You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2017/07/21 11:27:25 UTC

[38/50] [abbrv] directory-kerby git commit: DIRKRB-577 Improve for better latency measuring in kerby KDC. Contributed by Qing.

DIRKRB-577 Improve for better latency measuring in kerby KDC. Contributed by Qing.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/cc050f05
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/cc050f05
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/cc050f05

Branch: refs/heads/gssapi
Commit: cc050f055460678ea3102b0da89d313cd4f5a391
Parents: 8a7e206
Author: plusplusjiajia <ji...@intel.com>
Authored: Fri Jun 3 16:21:06 2016 +0800
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Jul 21 12:25:51 2017 +0100

----------------------------------------------------------------------
 .../kerberos/tool/kinit/KinitToolWithConcurrence.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/cc050f05/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitToolWithConcurrence.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitToolWithConcurrence.java b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitToolWithConcurrence.java
index 7427307..08bbb8f 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitToolWithConcurrence.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitToolWithConcurrence.java
@@ -234,7 +234,7 @@ public class KinitToolWithConcurrence {
             Long now = System.currentTimeMillis();
 
             for (int j = 0; j < threadNumbers; j++) {
-                delayNumbers[j] = reList[j * INTERVAL] - delayNumbers[j];
+                delayNumbers[j] = reList[j * INTERVAL] - tempDelayNumbers[j];
                 tempDelayNumbers[j] =  reList[j * INTERVAL];
             }
 
@@ -243,7 +243,8 @@ public class KinitToolWithConcurrence {
             }
             float res = (now - startTime) / 1000;
 
-            int totalDelay = 0;
+            double totalDelay = 0.0;
+            int cutThreads = 0;
             for (int j = 0; j < threadNumbers; j++) {
                 if (delayNumbers[j] != 0) {
                     if (delayNumbers[max] < delayNumbers[j]) {
@@ -252,12 +253,14 @@ public class KinitToolWithConcurrence {
                     if (delayNumbers[min] == 0 || delayNumbers[min] > delayNumbers[j]) {
                         min = j;
                     }
-                    totalDelay += (now - startTime) / delayNumbers[j];
+                    totalDelay += (now - startTime) * 1.0 / delayNumbers[j];
+                } else {
+                    cutThreads += 1;
                 }
             }
             if (delayNumbers[min] != 0 && delayNumbers[max] != 0) {
                 System.out.println((now - timeStamp) / 1000 + "," + (temp - tmpTotals) / res
-                        + "," + totalDelay / threadNumbers
+                        + "," + (int) (totalDelay / (threadNumbers - cutThreads))
                         + "," + (now - startTime) / delayNumbers[min] + "," + (now - startTime) / delayNumbers[max]);
             }