mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 07:26:47 +00:00
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>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-server</artifactId>
|
<artifactId>jetty-server</artifactId>
|
||||||
<version>7.2.2.v20101205</version>
|
<version>7.3.1.v20110307</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-client</artifactId>
|
<artifactId>jetty-client</artifactId>
|
||||||
<version>7.2.2.v20101205</version>
|
<version>7.3.1.v20110307</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -90,6 +90,7 @@ public static void main(String[] args) throws Exception {
|
|||||||
content[i] = (byte) ((r + i) % 96 + 32);
|
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 target1 = new URI("http", null, "localhost", port, "/rnd", "c=" + contentLen, null);
|
||||||
URI target2 = new URI("http", null, "localhost", port, "/echo", null, null);
|
URI target2 = new URI("http", null, "localhost", port, "/echo", null, null);
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ public static void main(String[] args) throws Exception {
|
|||||||
try {
|
try {
|
||||||
agent.init();
|
agent.init();
|
||||||
// Warm up
|
// Warm up
|
||||||
agent.get(target1, 5, 500);
|
agent.get(warmup, 5, 500);
|
||||||
// Sleep a little
|
// Sleep a little
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
System.out.println("=================================");
|
System.out.println("=================================");
|
||||||
|
@ -125,7 +125,11 @@ public void run() {
|
|||||||
contentLen += l;
|
contentLen += l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.stats.success(contentLen);
|
if (httpmethod.getStatusCode() == 200) {
|
||||||
|
this.stats.success(contentLen);
|
||||||
|
} else {
|
||||||
|
this.stats.failure(contentLen);
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
this.stats.failure(contentLen);
|
this.stats.failure(contentLen);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -151,7 +151,11 @@ public void run() {
|
|||||||
instream.close();
|
instream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.stats.success(contentLen);
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
this.stats.success(contentLen);
|
||||||
|
} else {
|
||||||
|
this.stats.failure(contentLen);
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
this.stats.failure(contentLen);
|
this.stats.failure(contentLen);
|
||||||
request.abort();
|
request.abort();
|
||||||
|
@ -195,7 +195,11 @@ public void run() {
|
|||||||
it.next();
|
it.next();
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
this.stats.success(contentLen);
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
this.stats.success(contentLen);
|
||||||
|
} else {
|
||||||
|
this.stats.failure(contentLen);
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
this.stats.failure(contentLen);
|
this.stats.failure(contentLen);
|
||||||
} catch (HttpException ex) {
|
} catch (HttpException ex) {
|
||||||
|
@ -70,6 +70,7 @@ Stats execute(final URI targetURI, byte[] content, int n, int c) throws Exceptio
|
|||||||
try {
|
try {
|
||||||
this.client.send(exchange);
|
this.client.send(exchange);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
stats.failure(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.waitFor();
|
stats.waitFor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user