In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
How to carry out java concurrent simulation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Create a new controller,TestController.java in project-1 as follows:
@ RestController@Slf4jpublic class TestController {@ GetMapping ("/ test") public String test () {return "test";}}
You need to rely on the Slf4j package, and you need to add dependencies in the pom.xml file:
Org.projectlombok lombok 1.18.6 POSTMAN tool Test
Create a new collection in the postman tool:
Add the test url to the collection, click run, and then configure:
Apache bench tool
Download address: https://www.apachelounge.com/download/
Ab-n 1000-c 50 http://localhost:8080/test
The output is as follows:
C:\ Users\ vincent > ab-n 1000-c 50 http://localhost:8080/testThis is ApacheBench, Version 2.3 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 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requestsServer Software:Server Hostname: localhostServer Port: 8080Document Path: / testDocument Length: 4 bytesConcurrency Level: 50Time taken for tests: 0.673 secondsComplete requests: 1000Failed requests: 0Total transferred: 136000 bytesHTML transferred: 4000 bytesRequests 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] receivedConnection Times (ms) min mean [+ /-sd] median maxConnect: 0 00.30 1Processing: 1 1919.8 15 291Waiting: 0 1616.7 12 278Total: 1 20 19.8 15 292Percentage 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% 292 (longest request)
-n 1000 indicates that the total number of tests is 100.
-c 50 indicates that the number of concurrency of this request is 50
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.