File tree 4 files changed +7163
-186
lines changed
4 files changed +7163
-186
lines changed Original file line number Diff line number Diff line change 18
18
"test:watch" : " jest --watch" ,
19
19
"test:cov" : " jest --coverage" ,
20
20
"test:debug" : " node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand" ,
21
- "test:e2e" : " jest --config ./test/jest-e2e.json"
21
+ "test:e2e" : " jest --config ./test/jest-e2e.json" ,
22
+ "test:load" : " artillery run socket-test.yml"
22
23
},
23
24
"dependencies" : {
24
25
"@ffmpeg-installer/ffmpeg" : " ^1.1.0" ,
38
39
"@types/fluent-ffmpeg" : " ^2.1.27" ,
39
40
"@types/jest" : " ^29.5.14" ,
40
41
"@types/socket.io" : " ^3.0.2" ,
42
+ "artillery-engine-socketio-v3" : " ^1.2.0" ,
41
43
"aws-sdk" : " ^2.1692.0" ,
42
44
"bcrypt" : " ^5.1.1" ,
43
45
"cache-manager" : " 5.2.3" ,
74
76
"@types/node" : " ^22.9.0" ,
75
77
"@typescript-eslint/eslint-plugin" : " ^6.0.0" ,
76
78
"@typescript-eslint/parser" : " ^6.0.0" ,
79
+ "artillery" : " ^2.0.21" ,
77
80
"eslint" : " ^8.42.0" ,
78
81
"eslint-config-prettier" : " ^9.0.0" ,
79
82
"eslint-plugin-prettier" : " ^5.0.0" ,
Original file line number Diff line number Diff line change
1
+ config :
2
+ # 일단 로컬 환경 URL
3
+ target : ' http://localhost:3000'
4
+ phases :
5
+ # 10초 동안
6
+ - duration : 10
7
+ # 1초에 20명
8
+ arrivalRate : 20
9
+ engines :
10
+ socketio-v3 :
11
+ transports : ['websocket']
12
+ timeout : 10000
13
+ variables :
14
+ # 원하는 roomId 설정
15
+ roomId : ' 7b82b46b-d705-48a5-9bc5-918ee1a124a0'
16
+ scenarios :
17
+ - name : ' Chat room flow'
18
+ engine : socketio-v3
19
+ flow :
20
+ - think : 1
21
+
22
+ - namespace : ' /rooms'
23
+ connect :
24
+ query : ' roomId={{ roomId }}'
25
+ headers :
26
+ x-forwarded-for : ' {{ $randomNumber(1000000, 9999999) }}'
27
+
28
+ - think : 2
29
+
30
+ - namespace : ' /rooms'
31
+ emit :
32
+ channel : ' message'
33
+ data :
34
+ message : ' Test message'
35
+ roomId : ' {{ roomId }}'
36
+
37
+ - think : 1
38
+
39
+ - namespace : ' /rooms'
40
+ emit :
41
+ channel : ' vote'
42
+ data :
43
+ # 일단 노래 두 개가 있다고 가정하고, 랜덤 값 지정
44
+ trackNumber : " {{ $randomNumber(1,2) }}"
45
+
46
+ - think : 30
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export class RandomNameUtil {
24
24
'청결한' ,
25
25
'상냥한' ,
26
26
'예의바른' ,
27
- '높은 ' ,
27
+ '높은' ,
28
28
'먼' ,
29
29
'정직한' ,
30
30
'성실한' ,
@@ -49,7 +49,7 @@ export class RandomNameUtil {
49
49
'고릴라' ,
50
50
'자리' ,
51
51
'코뿔소' ,
52
- '북극곰 ' ,
52
+ '북극곰' ,
53
53
'회색곰' ,
54
54
'침팬지' ,
55
55
'돌고래' ,
@@ -59,7 +59,7 @@ export class RandomNameUtil {
59
59
'토끼' ,
60
60
] ;
61
61
62
- public static generate ( ) {
62
+ public static generate ( ) : string {
63
63
const adjectvieLength = RandomNameUtil . adjective . length ;
64
64
const animalLength = RandomNameUtil . animal . length ;
65
65
You can’t perform that action at this time.
0 commit comments