reporter.setStatus("Record: "+staticCount+"("+staticWrite+"w, "+staticRead+"r), Write Size: "
+staticWriteSize+", Write Time: "+staticWriteTime
+", Read Size: "+staticReadSize+", Read Time: "+staticReadTime);
httpurlconnection.getOutputStream().write(sb.toString().getBytes());
httpurlconnection.getOutputStream().flush();
httpurlconnection.getOutputStream().close();
int code = httpurlconnection.getResponseCode();
if(code != 200) {
LOG.warn("send data to master server failed, code=" + code);
}
reporter.incrCounter("TestTool", "Http Post num", 1);
map.staticPost.addAndGet(1);
Thread.sleep(interval);
} catch (Exception e) {
map.staticPost.addAndGet(1);
reporter.incrCounter("TestTool", e.getClass().toString(), 1);
原文转自:http://www.taobaotest.com/blogs/2515