??????????????HttpServer?????????????
???????????? ???????[ 2014/2/28 10:21:22 ] ?????????????? ???? ????
???????????????????????????????????????????????????????????????????
???????? ???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;
????}
????/**
????* ??????У?????????????????????????????????????????н??????д??
????* ?????????????????????б??
????*/
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11