测试线程改到50个,一次生成200个
This commit is contained in:
@@ -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#");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user