Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D9681200B5B for ; Thu, 30 Jun 2016 10:53:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D8346160A51; Thu, 30 Jun 2016 08:53:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DBB97160A71 for ; Thu, 30 Jun 2016 10:53:50 +0200 (CEST) Received: (qmail 97631 invoked by uid 500); 30 Jun 2016 08:53:49 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 95741 invoked by uid 99); 30 Jun 2016 08:53:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2016 08:53:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D0FAADFF03; Thu, 30 Jun 2016 08:53:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: drankye@apache.org To: commits@directory.apache.org Date: Thu, 30 Jun 2016 08:54:10 -0000 Message-Id: <2eea25f40d304be1ad88ab7183746b78@git.apache.org> In-Reply-To: <19c327db7623444a91b9a5859944fa8f@git.apache.org> References: <19c327db7623444a91b9a5859944fa8f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/44] directory-kerby git commit: DIRKRB-577 Improve for better latency measuring in kerby KDC. Contributed by Qing. archived-at: Thu, 30 Jun 2016 08:53:53 -0000 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 Authored: Fri Jun 3 16:21:06 2016 +0800 Committer: plusplusjiajia 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]); }