应用MapReduce制作压测利器(6)

发表于:2014-06-25来源:淘测试作者:凡提点击数: 标签:
this . recordnum ); reporter .setStatus( Record: +staticCount+ ( +staticWrite+ w, +staticRead+ r), Write Size: +staticWriteSize+ , Write Time: +staticWriteTime + , Read Size: +staticReadSize+ , Read T
this.recordnum);

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