测试线程改到50个,一次生成200个

This commit is contained in:
杨黄林
2022-02-09 13:02:44 +08:00
parent 55070d1222
commit 970eb892fb
2 changed files with 3 additions and 3 deletions

View File

@@ -25,8 +25,8 @@ public class Startup implements ApplicationRunner {
Set<String> set = new HashSet<>();
//开启多线程进行测试
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 10, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(100));
for (int i = 0; i < 5; i++) {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(50, 50, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(1000));
for (int i = 0; i < 200; i++) {
threadPoolExecutor.execute(() -> {
Sequences sequences = generator.generate("SNT", "MISSION");
String formattedSeq = generator.format(sequences.getSeq(), 5, "处〔#year#10801#seq#");

View File

@@ -3,4 +3,4 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/sequence
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
driver-class-name: com.mysql.cj.jdbc.Driver