Upgraded Jetty; minor benchmark improvements
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1080382 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3e3302b7e
commit
dcfced133b
|
@ -74,13 +74,13 @@
|
|||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>7.2.2.v20101205</version>
|
||||
<version>7.3.1.v20110307</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>7.2.2.v20101205</version>
|
||||
<version>7.3.1.v20110307</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -90,6 +90,7 @@ public class Benchmark {
|
|||
content[i] = (byte) ((r + i) % 96 + 32);
|
||||
}
|
||||
|
||||
URI warmup = new URI("http", null, "localhost", port, "/rnd", "c=2048", null);
|
||||
URI target1 = new URI("http", null, "localhost", port, "/rnd", "c=" + contentLen, null);
|
||||
URI target2 = new URI("http", null, "localhost", port, "/echo", null, null);
|
||||
|
||||
|
@ -98,7 +99,7 @@ public class Benchmark {
|
|||
try {
|
||||
agent.init();
|
||||
// Warm up
|
||||
agent.get(target1, 5, 500);
|
||||
agent.get(warmup, 5, 500);
|
||||
// Sleep a little
|
||||
Thread.sleep(5000);
|
||||
System.out.println("=================================");
|
||||
|
|
|
@ -125,7 +125,11 @@ public class TestHttpClient3 implements TestHttpAgent {
|
|||
contentLen += l;
|
||||
}
|
||||
}
|
||||
if (httpmethod.getStatusCode() == 200) {
|
||||
this.stats.success(contentLen);
|
||||
} else {
|
||||
this.stats.failure(contentLen);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
this.stats.failure(contentLen);
|
||||
} finally {
|
||||
|
|
|
@ -151,7 +151,11 @@ public class TestHttpClient4 implements TestHttpAgent {
|
|||
instream.close();
|
||||
}
|
||||
}
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
this.stats.success(contentLen);
|
||||
} else {
|
||||
this.stats.failure(contentLen);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
this.stats.failure(contentLen);
|
||||
request.abort();
|
||||
|
|
|
@ -195,7 +195,11 @@ public class TestHttpCore implements TestHttpAgent {
|
|||
it.next();
|
||||
it.remove();
|
||||
}
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
this.stats.success(contentLen);
|
||||
} else {
|
||||
this.stats.failure(contentLen);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
this.stats.failure(contentLen);
|
||||
} catch (HttpException ex) {
|
||||
|
|
|
@ -70,6 +70,7 @@ public class TestJettyHttpClient implements TestHttpAgent {
|
|||
try {
|
||||
this.client.send(exchange);
|
||||
} catch (IOException ex) {
|
||||
stats.failure(0);
|
||||
}
|
||||
}
|
||||
stats.waitFor();
|
||||
|
|
Loading…
Reference in New Issue