hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1080204 - in /httpcomponents/httpclient/trunk/httpclient-benchmark: ./ src/main/java/org/apache/http/client/benchmark/
Date Thu, 10 Mar 2011 12:55:43 GMT
Author: olegk
Date: Thu Mar 10 12:55:42 2011
New Revision: 1080204

URL: http://svn.apache.org/viewvc?rev=1080204&view=rev
Log:
HttpClient benchmark improvements

Modified:
    httpcomponents/httpclient/trunk/httpclient-benchmark/pom.xml
    httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Benchmark.java
    httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Stats.java
    httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/TestNingHttpClient.java

Modified: httpcomponents/httpclient/trunk/httpclient-benchmark/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-benchmark/pom.xml?rev=1080204&r1=1080203&r2=1080204&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-benchmark/pom.xml (original)
+++ httpcomponents/httpclient/trunk/httpclient-benchmark/pom.xml Thu Mar 10 12:55:42 2011
@@ -74,13 +74,13 @@
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
-      <version>7.2.0.v20101020</version>
+      <version>7.2.2.v20101205</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-client</artifactId>
-      <version>7.2.0.v20101020</version>
+      <version>7.2.2.v20101205</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
@@ -98,7 +98,7 @@
     <dependency>
       <groupId>com.ning</groupId>
       <artifactId>async-http-client</artifactId>
-      <version>1.4.0</version>
+      <version>1.5.0</version>
       <scope>compile</scope>
     </dependency>
   </dependencies>

Modified: httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Benchmark.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Benchmark.java?rev=1080204&r1=1080203&r2=1080204&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Benchmark.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Benchmark.java
Thu Mar 10 12:55:42 2011
@@ -49,7 +49,7 @@ public class Benchmark {
    public static void main(String[] args) throws Exception {
 
        String ns = System.getProperty("hc.benchmark.n-requests", "200000");
-       String nc = System.getProperty("hc.benchmark.concurrent", "100");
+       String nc = System.getProperty("hc.benchmark.concurrent", "20");
        String cls = System.getProperty("hc.benchmark.content-len", "2048");
 
        int n = Integer.parseInt(ns);
@@ -75,9 +75,6 @@ public class Benchmark {
        server.start();
        int port = connector.getLocalPort();
 
-       // Sleep a little
-       Thread.sleep(2000);
-
        TestHttpAgent[] agents = new TestHttpAgent[] {
                new TestHttpClient3(),
                new TestHttpJRE(),
@@ -98,8 +95,12 @@ public class Benchmark {
 
        try {
            for (TestHttpAgent agent: agents) {
-               agent.init();
                try {
+                   agent.init();
+                   // Warm up
+                   agent.get(target1, 5, 500);
+                   // Sleep a little
+                   Thread.sleep(5000);
                    System.out.println("=================================");
                    System.out.println("HTTP agent: " + agent.getClientName());
                    System.out.println("---------------------------------");
@@ -121,7 +122,6 @@ public class Benchmark {
                } finally {
                    agent.shutdown();
                }
-               agent.init();
                System.out.println("---------------------------------");
            }
        } finally {

Modified: httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Stats.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Stats.java?rev=1080204&r1=1080203&r2=1080204&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Stats.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/Stats.java
Thu Mar 10 12:55:42 2011
@@ -97,7 +97,6 @@ public class Stats {
             final URI targetURI, long startTime, long finishTime, final Stats stats) {
         float totalTimeSec = (float) (finishTime - startTime) / 1000;
         float reqsPerSec = (float) stats.getSuccessCount() / totalTimeSec;
-        float timePerReqMs = (float) (finishTime - startTime) / (float) stats.getSuccessCount();
 
         System.out.print("Document URI:\t\t");
         System.out.println(targetURI);
@@ -120,9 +119,6 @@ public class Stats {
         System.out.print("Requests per second:\t");
         System.out.print(reqsPerSec);
         System.out.println(" [#/sec] (mean)");
-        System.out.print("Time per request:\t");
-        System.out.print(timePerReqMs);
-        System.out.println(" [ms] (mean)");
     }
 
 }
\ No newline at end of file

Modified: httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/TestNingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/TestNingHttpClient.java?rev=1080204&r1=1080203&r2=1080204&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/TestNingHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/TestNingHttpClient.java
Thu Mar 10 12:55:42 2011
@@ -94,7 +94,7 @@ public class TestNingHttpClient implemen
     }
 
     public String getClientName() {
-        return "Ning Async HTTP client 1.4.0";
+        return "Ning async HTTP client 1.5.0";
     }
 
     static class SimpleAsyncHandler implements AsyncHandler<Object> {



Mime
View raw message