符合中小企业对网站设计、功能常规化式的企业展示型网站建设
本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...
商城网站建设因基本功能的需求不同费用上面也有很大的差别...
手机微信网站开发、微信官网、微信商城网站...
怎么进行java并发模拟,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。
为石景山等地区用户提供了全套网页设计制作服务,及石景山网站建设行业解决方案。主营业务为成都网站制作、网站设计、石景山网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
在project-1中新建controller,TestController.java内容如下:
@RestController @Slf4j public class TestController { @GetMapping("/test") public String test() { return "test"; } }
需要依赖Slf4j包,需要在pom.xml文件中添加依赖:
org.projectlombok lombok 1.18.6
在postman工具中新建collection:
并将测试url添加到这个collection中,点击run,然后配置:
下载地址:https://www.apachelounge.com/download/
ab -n 1000 -c 50 http://localhost:8080/test
输出结果如下:
C:\Users\vincent>ab -n 1000 -c 50 http://localhost:8080/test This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests Server Software: Server Hostname: localhost Server Port: 8080 Document Path: /test Document Length: 4 bytes Concurrency Level: 50 Time taken for tests: 0.673 seconds Complete requests: 1000 Failed requests: 0 Total transferred: 136000 bytes HTML transferred: 4000 bytes Requests per second: 1486.74 [#/sec] (mean) Time per request: 33.631 [ms] (mean) Time per request: 0.673 [ms] (mean, across all concurrent requests) Transfer rate: 197.46 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.3 0 1 Processing: 1 19 19.8 15 291 Waiting: 0 16 16.7 12 278 Total: 1 20 19.8 15 292 Percentage of the requests served within a certain time (ms) 50% 15 66% 19 75% 23 80% 24 90% 33 95% 62 98% 84 99% 99 100% 292 (longest request)
-n 1000表示本次测试的总数为100个
-c 50表示本次请求的并发数是50
看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注创新互联行业资讯频道,感谢您对创新互联的支持。