directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [23/44] directory-kerby git commit: DIRKRB-577 Improve for better latency measuring in kerby KDC. Contributed by Qing.
Date Thu, 30 Jun 2016 08:54:10 GMT
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/002b873f
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/002b873f
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/002b873f

Branch: refs/heads/gssapi
Commit: 002b873f2378d427053b457223b3d860977db951
Parents: 7414732
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Jun 3 16:21:06 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Jun 3 16:21:06 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/002b873f/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]);
             }
 


Mime
View raw message