???????????????????????????????????????????????????????????????????

???????? ???http???????url??params??????????????????????????????????????????

??????????????????????????????????????????????????????????????ν??????????

???????????????????????????????????????????????????????JDK?????HttpServer???????????ж?JDK???????Щ???ε???????????????????????????????????????????????????????

????????λ????????????????Щ?????????????????????????????????1~2??????£??????????????????????????????????μ????????????????????д??????????λ??????????????

??????????????????????????????????? http://127.0.0.1/getlog?id=123&path=testlog&type=r??????????????testlog????????????????devlog?????????????????????λ???????????????????λ?????????????????????

??????????????url?е?????????????????£?

????Map Params = (Map) httpExchange.getAttribute(“parameters”);

????JDK?????????????????????getAttribute??

????Filter modules may store arbitrary objects with HttpExchange instances as an out-of-band communication mechanism. Other Filters or the exchange handler may then access these objects.

????????????????????????????????????????????????????д????????????

????1000???????·?10000?????????????????????????????????????????????????????????????????????1000??????????????????????

????httpExchange.getAttribute()???????????????£??????????????????

????public class HttpServersPerfTest extends BaseCase {

????private static final Log logger = LogFactory.getLog(AlisaNodeHttpServersPerfTest.class);

????int maxThread = 1000;

????private int totalTask = 1000;

????@Test

????public void testRequestRunningLog() throws InterruptedException {

????execute();

????}

????private void execute() throws InterruptedException {

????ExecutorService pool = Executors.newFixedThreadPool(maxThread);

????final CountDownLatch countDownLatch = new CountDownLatch(totalTask);

????for (int n = 0; n < totalTask; n++) {

????pool.execute(new RequestHttpServerThread(countDownLatch));

????}

????try {

????countDownLatch.await();

????System.err.println(“==============>>>>> ?·?????” );

????} catch (InterruptedException e) {

????e.printStackTrace();

????}

????}

????private class RequestHttpServerThread implements Runnable {

????private CountDownLatch countDownLatch;

????public RequestHttpServerThread(CountDownLatch countDownLatch) {

????this.countDownLatch = countDownLatch;

????}

????/**

????* ??????У?????????????????????????????????????????н??????д??

????* ?????????????????????б??

????*/