List of usage examples for org.apache.http.client.benchmark Stats Stats
public Stats(int expectedCount, int concurrency)
From source file:org.apache.http.client.benchmark.TestHttpClient3.java
Stats execute(final URI target, final byte[] content, int n, int c) throws Exception { this.mgr.getParams().setMaxTotalConnections(2000); this.mgr.getParams().setDefaultMaxConnectionsPerHost(c); Stats stats = new Stats(n, c); WorkerThread[] workers = new WorkerThread[c]; for (int i = 0; i < workers.length; i++) { workers[i] = new WorkerThread(stats, target, content); }/*from w w w . j a va 2 s . co m*/ for (int i = 0; i < workers.length; i++) { workers[i].start(); } for (int i = 0; i < workers.length; i++) { workers[i].join(); } return stats; }