Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 528B6B9D8 for ; Mon, 16 Jan 2012 04:17:31 +0000 (UTC) Received: (qmail 18893 invoked by uid 500); 16 Jan 2012 04:17:29 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 18759 invoked by uid 500); 16 Jan 2012 04:17:18 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 18752 invoked by uid 99); 16 Jan 2012 04:17:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2012 04:17:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2012 04:17:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 81D2823888FD for ; Mon, 16 Jan 2012 04:16:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1231830 - in /cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal: TestCaseBase.java TestResult.java Date: Mon, 16 Jan 2012 04:16:50 -0000 To: commits@cxf.apache.org From: ema@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120116041650.81D2823888FD@eris.apache.org> Author: ema Date: Mon Jan 16 04:16:50 2012 New Revision: 1231830 URL: http://svn.apache.org/viewvc?rev=1231830&view=rev Log: Add the overall beanchmar result for all TestRunners Modified: cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestCaseBase.java cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestResult.java Modified: cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestCaseBase.java URL: http://svn.apache.org/viewvc/cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestCaseBase.java?rev=1231830&r1=1231829&r2=1231830&view=diff ============================================================================== --- cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestCaseBase.java (original) +++ cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestCaseBase.java Mon Jan 16 04:16:50 2012 @@ -299,6 +299,24 @@ public abstract class TestCaseBase { e.printStackTrace(); } } + printResult(); + } + private void printResult() { + double totalDuration = 0; + double totalInvocations = 0; + for (TestResult testResult : results) { + totalDuration = totalDuration + testResult.getDuration(); + totalInvocations = totalInvocations + testResult.getNumOfInvocations(); + } + double totalThroughput = totalInvocations/totalDuration; + double totalAvgResponseTime = totalDuration/totalInvocations; + System.out.println(); + System.out.println("=============Overall Test Result============"); + System.out.println("Overall Throughput: " + this.getOperationName() + " " + totalThroughput + TestResult.THROUGHPUT_UNIT); + System.out.println("Overall AVG. response time: " + totalAvgResponseTime * 1000 + TestResult.AVG_UNIT); + System.out.println(totalInvocations + " (invocations), running " + totalDuration + " (sec) "); + System.out.println("============================================"); + } public void run() { Modified: cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestResult.java URL: http://svn.apache.org/viewvc/cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestResult.java?rev=1231830&r1=1231829&r2=1231830&view=diff ============================================================================== --- cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestResult.java (original) +++ cxf/trunk/benchmark/performance/base/src/main/java/org/apache/cxf/pat/internal/TestResult.java Mon Jan 16 04:16:50 2012 @@ -21,11 +21,14 @@ package org.apache.cxf.pat.internal; public class TestResult { public static final String AVG_UNIT = " (ms)"; - private static final String THROUGHPUT_UNIT = " (invocations/sec)"; + public static final String THROUGHPUT_UNIT = " (invocations/sec)"; private String name; private TestCaseBase testCase; + private double duration; + private double numOfInvocations; + private double avgResponseTime; private double throughput; @@ -43,15 +46,17 @@ public class TestResult { } public void compute(long startTime, long endTime, int numberOfInvocations) { - double numOfInvocations = (double)numberOfInvocations; - double duration = convertToSeconds(endTime - startTime); + numOfInvocations = (double)numberOfInvocations; + duration = convertToSeconds(endTime - startTime); throughput = numOfInvocations / duration; avgResponseTime = duration / numOfInvocations; - + System.out.println(); + System.out.println("--------------Test Result of " + this.getName() + "-------------"); System.out.println("Throughput: " + testCase.getOperationName() + " " + throughput + THROUGHPUT_UNIT); System.out.println("AVG. response time: " + avgResponseTime * 1000 + AVG_UNIT); System.out.println(numOfInvocations + " (invocations), running " + duration + " (sec) "); + System.out.println("---------------------------------------------------------"); } @@ -70,4 +75,12 @@ public class TestResult { public double getThroughput() { return throughput; } + + public double getDuration() { + return duration; + } + + public double getNumOfInvocations() { + return numOfInvocations; + } }