@nestia/benchmark 7.3.1 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,8 +15,8 @@ import { IBenchmarkServant } from "./internal/IBenchmarkServant";
|
|
|
15
15
|
* Therefore, when you want to benchmark the performance of a backend server,
|
|
16
16
|
* you have to make two programs; one for calling the
|
|
17
17
|
* {@link DynamicBenchmarker.master} function, and the other for calling the
|
|
18
|
-
* {@link DynamicBenchmarker.servant} function. Also, never forget to write
|
|
19
|
-
*
|
|
18
|
+
* {@link DynamicBenchmarker.servant} function. Also, never forget to write the
|
|
19
|
+
* path of the servant program to the
|
|
20
20
|
* {@link DynamicBenchmarker.IMasterProps.servant} property.
|
|
21
21
|
*
|
|
22
22
|
* Also, you when you complete the benchmark execution through the
|
|
@@ -24,21 +24,20 @@ import { IBenchmarkServant } from "./internal/IBenchmarkServant";
|
|
|
24
24
|
* functions, you can convert the result to markdown content by using the
|
|
25
25
|
* {@link DynamicBenchmarker.markdown} function.
|
|
26
26
|
*
|
|
27
|
-
* Additionally, if you hope to see some utilization cases,
|
|
28
|
-
*
|
|
27
|
+
* Additionally, if you hope to see some utilization cases, see the below
|
|
28
|
+
* example tagged links.
|
|
29
29
|
*
|
|
30
|
-
* @example https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
31
|
-
* @example https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
32
30
|
* @author Jeongho Nam - https://github.com/samchon
|
|
31
|
+
* @example
|
|
32
|
+
* https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
33
36
|
*/
|
|
34
37
|
export declare namespace DynamicBenchmarker {
|
|
35
|
-
/**
|
|
36
|
-
* Properties of the master program.
|
|
37
|
-
*/
|
|
38
|
+
/** Properties of the master program. */
|
|
38
39
|
interface IMasterProps {
|
|
39
|
-
/**
|
|
40
|
-
* Total count of the requests.
|
|
41
|
-
*/
|
|
40
|
+
/** Total count of the requests. */
|
|
42
41
|
count: number;
|
|
43
42
|
/**
|
|
44
43
|
* Number of threads.
|
|
@@ -51,7 +50,8 @@ export declare namespace DynamicBenchmarker {
|
|
|
51
50
|
*
|
|
52
51
|
* The number of requests to be executed simultaneously.
|
|
53
52
|
*
|
|
54
|
-
* This property value would be divided by the {@link threads} in the
|
|
53
|
+
* This property value would be divided by the {@link threads} in the
|
|
54
|
+
* servants.
|
|
55
55
|
*/
|
|
56
56
|
simultaneous: number;
|
|
57
57
|
/**
|
|
@@ -64,8 +64,8 @@ export declare namespace DynamicBenchmarker {
|
|
|
64
64
|
/**
|
|
65
65
|
* Filter function.
|
|
66
66
|
*
|
|
67
|
-
* The filter function to determine whether to execute the function in
|
|
68
|
-
*
|
|
67
|
+
* The filter function to determine whether to execute the function in the
|
|
68
|
+
* servant or not.
|
|
69
69
|
*
|
|
70
70
|
* @param name Function name
|
|
71
71
|
* @returns Whether to execute the function or not.
|
|
@@ -82,9 +82,9 @@ export declare namespace DynamicBenchmarker {
|
|
|
82
82
|
*
|
|
83
83
|
* Get the memory usage of the master program.
|
|
84
84
|
*
|
|
85
|
-
* Specify this property only when your backend server is running on
|
|
86
|
-
*
|
|
87
|
-
*
|
|
85
|
+
* Specify this property only when your backend server is running on a
|
|
86
|
+
* different process, so that need to measure the memory usage of the
|
|
87
|
+
* backend server from other process.
|
|
88
88
|
*/
|
|
89
89
|
memory?: () => Promise<NodeJS.MemoryUsage>;
|
|
90
90
|
/**
|
|
@@ -94,9 +94,7 @@ export declare namespace DynamicBenchmarker {
|
|
|
94
94
|
*/
|
|
95
95
|
stdio?: undefined | "overlapped" | "pipe" | "ignore" | "inherit";
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Properties of the servant program.
|
|
99
|
-
*/
|
|
97
|
+
/** Properties of the servant program. */
|
|
100
98
|
interface IServantProps<Parameters extends any[]> {
|
|
101
99
|
/**
|
|
102
100
|
* Default connection.
|
|
@@ -104,34 +102,30 @@ export declare namespace DynamicBenchmarker {
|
|
|
104
102
|
* Default connection to be used in the servant.
|
|
105
103
|
*/
|
|
106
104
|
connection: IConnection;
|
|
107
|
-
/**
|
|
108
|
-
* Location of the benchmark functions.
|
|
109
|
-
*/
|
|
105
|
+
/** Location of the benchmark functions. */
|
|
110
106
|
location: string;
|
|
111
107
|
/**
|
|
112
108
|
* Prefix of the benchmark functions.
|
|
113
109
|
*
|
|
114
110
|
* Every prefixed function will be executed in the servant.
|
|
115
111
|
*
|
|
116
|
-
* In other words, if a function name doesn't start with the prefix,
|
|
117
|
-
*
|
|
112
|
+
* In other words, if a function name doesn't start with the prefix, then it
|
|
113
|
+
* would never be executed.
|
|
118
114
|
*/
|
|
119
115
|
prefix: string;
|
|
120
116
|
/**
|
|
121
117
|
* Get parameters of a function.
|
|
122
118
|
*
|
|
123
119
|
* When composing the parameters, never forget to copy the
|
|
124
|
-
* {@link IConnection.logger} property of default connection to the
|
|
125
|
-
*
|
|
120
|
+
* {@link IConnection.logger} property of default connection to the returning
|
|
121
|
+
* parameters.
|
|
126
122
|
*
|
|
127
123
|
* @param connection Default connection instance
|
|
128
124
|
* @param name Function name
|
|
129
125
|
*/
|
|
130
126
|
parameters: (connection: IConnection, name: string) => Parameters;
|
|
131
127
|
}
|
|
132
|
-
/**
|
|
133
|
-
* Benchmark report.
|
|
134
|
-
*/
|
|
128
|
+
/** Benchmark report. */
|
|
135
129
|
interface IReport {
|
|
136
130
|
count: number;
|
|
137
131
|
threads: number;
|
|
@@ -165,8 +159,8 @@ export declare namespace DynamicBenchmarker {
|
|
|
165
159
|
*
|
|
166
160
|
* Creates a master program that executing the servant programs in parallel.
|
|
167
161
|
*
|
|
168
|
-
* Note that, {@link IMasterProps.servant} property must be the path of
|
|
169
|
-
*
|
|
162
|
+
* Note that, {@link IMasterProps.servant} property must be the path of the
|
|
163
|
+
* servant program executing the {@link servant} function.
|
|
170
164
|
*
|
|
171
165
|
* @param props Properties of the master program
|
|
172
166
|
* @returns Benchmark report
|
|
@@ -137,8 +137,8 @@ var DynamicBenchmarkReporter_1 = require("./internal/DynamicBenchmarkReporter");
|
|
|
137
137
|
* Therefore, when you want to benchmark the performance of a backend server,
|
|
138
138
|
* you have to make two programs; one for calling the
|
|
139
139
|
* {@link DynamicBenchmarker.master} function, and the other for calling the
|
|
140
|
-
* {@link DynamicBenchmarker.servant} function. Also, never forget to write
|
|
141
|
-
*
|
|
140
|
+
* {@link DynamicBenchmarker.servant} function. Also, never forget to write the
|
|
141
|
+
* path of the servant program to the
|
|
142
142
|
* {@link DynamicBenchmarker.IMasterProps.servant} property.
|
|
143
143
|
*
|
|
144
144
|
* Also, you when you complete the benchmark execution through the
|
|
@@ -146,12 +146,15 @@ var DynamicBenchmarkReporter_1 = require("./internal/DynamicBenchmarkReporter");
|
|
|
146
146
|
* functions, you can convert the result to markdown content by using the
|
|
147
147
|
* {@link DynamicBenchmarker.markdown} function.
|
|
148
148
|
*
|
|
149
|
-
* Additionally, if you hope to see some utilization cases,
|
|
150
|
-
*
|
|
149
|
+
* Additionally, if you hope to see some utilization cases, see the below
|
|
150
|
+
* example tagged links.
|
|
151
151
|
*
|
|
152
|
-
* @example https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
153
|
-
* @example https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
154
152
|
* @author Jeongho Nam - https://github.com/samchon
|
|
153
|
+
* @example
|
|
154
|
+
* https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
155
158
|
*/
|
|
156
159
|
var DynamicBenchmarker;
|
|
157
160
|
(function (DynamicBenchmarker) {
|
|
@@ -161,8 +164,8 @@ var DynamicBenchmarker;
|
|
|
161
164
|
*
|
|
162
165
|
* Creates a master program that executing the servant programs in parallel.
|
|
163
166
|
*
|
|
164
|
-
* Note that, {@link IMasterProps.servant} property must be the path of
|
|
165
|
-
*
|
|
167
|
+
* Note that, {@link IMasterProps.servant} property must be the path of the
|
|
168
|
+
* servant program executing the {@link servant} function.
|
|
166
169
|
*
|
|
167
170
|
* @param props Properties of the master program
|
|
168
171
|
* @returns Benchmark report
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicBenchmarker.js","sourceRoot":"","sources":["../src/DynamicBenchmarker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AACpB,+BAA8D;AAC9D,6BAAgD;AAGhD,gFAA+E;AAI/E
|
|
1
|
+
{"version":3,"file":"DynamicBenchmarker.js","sourceRoot":"","sources":["../src/DynamicBenchmarker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AACpB,+BAA8D;AAC9D,6BAAgD;AAGhD,gFAA+E;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,IAAiB,kBAAkB,CA+TlC;AA/TD,WAAiB,kBAAkB;;IAqIjC;;;;;;;;;;OAUG;IACU,yBAAM,GAAG,UAAO,KAAmB;;;;;;;;oBACxC,SAAS,GAAa,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBAKvD,qBAAM,OAAO,CAAC,GAAG,CACrB,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC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;YACX,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,IAAI,IAAI,GAAW,CAAC,CAAC;IACrB,IAAI,KAAK,GAAW,CAAC,CAAC;IACtB,IAAI,OAAO,GAAW,MAAM,CAAC,gBAAgB,CAAC;IAC9C,IAAI,OAAO,GAAW,MAAM,CAAC,gBAAgB,CAAC;;QAC9C,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE,CAAC;YAAxB,IAAM,OAAK,mBAAA;YACd,IAAM,OAAO,GACX,IAAI,IAAI,CAAC,OAAK,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;gBACtC,IAAI,IAAI,CAAC,OAAK,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;YACvC,IAAI,IAAI,OAAO,CAAC;YAChB,KAAK,IAAI,OAAO,GAAG,OAAO,CAAC;YAC3B,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACrC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;;;;;;;;;IACD,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC;IACtB,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACvD,OAAO,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,OAAO,SAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AAC3C,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/benchmark",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.3",
|
|
4
4
|
"description": "NestJS Performance Benchmark Program",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"url": "https://github.com/samchon/nestia"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nestia/fetcher": "^7.3.
|
|
33
|
+
"@nestia/fetcher": "^7.3.3",
|
|
34
34
|
"tgrid": "^1.1.0",
|
|
35
35
|
"tstl": "^3.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@nestia/core": "^7.3.
|
|
39
|
-
"@nestia/e2e": "^7.3.
|
|
40
|
-
"@nestia/sdk": "^7.3.
|
|
38
|
+
"@nestia/core": "^7.3.3",
|
|
39
|
+
"@nestia/e2e": "^7.3.3",
|
|
40
|
+
"@nestia/sdk": "^7.3.3",
|
|
41
41
|
"@nestjs/common": "^11.0.13",
|
|
42
42
|
"@nestjs/core": "^11.0.13",
|
|
43
43
|
"@nestjs/platform-express": "^11.0.13",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"nestia": "workspace:^",
|
|
46
46
|
"ts-node": "^10.9.2",
|
|
47
47
|
"ts-patch": "^3.3.0",
|
|
48
|
-
"typescript": "~5.
|
|
48
|
+
"typescript": "~5.9.2",
|
|
49
49
|
"typescript-transform-paths": "^3.4.7",
|
|
50
|
-
"typia": "^9.
|
|
50
|
+
"typia": "^9.6.1",
|
|
51
51
|
"uuid": "^10.0.0"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
@@ -21,8 +21,8 @@ import { IBenchmarkServant } from "./internal/IBenchmarkServant";
|
|
|
21
21
|
* Therefore, when you want to benchmark the performance of a backend server,
|
|
22
22
|
* you have to make two programs; one for calling the
|
|
23
23
|
* {@link DynamicBenchmarker.master} function, and the other for calling the
|
|
24
|
-
* {@link DynamicBenchmarker.servant} function. Also, never forget to write
|
|
25
|
-
*
|
|
24
|
+
* {@link DynamicBenchmarker.servant} function. Also, never forget to write the
|
|
25
|
+
* path of the servant program to the
|
|
26
26
|
* {@link DynamicBenchmarker.IMasterProps.servant} property.
|
|
27
27
|
*
|
|
28
28
|
* Also, you when you complete the benchmark execution through the
|
|
@@ -30,21 +30,20 @@ import { IBenchmarkServant } from "./internal/IBenchmarkServant";
|
|
|
30
30
|
* functions, you can convert the result to markdown content by using the
|
|
31
31
|
* {@link DynamicBenchmarker.markdown} function.
|
|
32
32
|
*
|
|
33
|
-
* Additionally, if you hope to see some utilization cases,
|
|
34
|
-
*
|
|
33
|
+
* Additionally, if you hope to see some utilization cases, see the below
|
|
34
|
+
* example tagged links.
|
|
35
35
|
*
|
|
36
|
-
* @example https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
37
|
-
* @example https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
38
36
|
* @author Jeongho Nam - https://github.com/samchon
|
|
37
|
+
* @example
|
|
38
|
+
* https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
|
|
39
42
|
*/
|
|
40
43
|
export namespace DynamicBenchmarker {
|
|
41
|
-
/**
|
|
42
|
-
* Properties of the master program.
|
|
43
|
-
*/
|
|
44
|
+
/** Properties of the master program. */
|
|
44
45
|
export interface IMasterProps {
|
|
45
|
-
/**
|
|
46
|
-
* Total count of the requests.
|
|
47
|
-
*/
|
|
46
|
+
/** Total count of the requests. */
|
|
48
47
|
count: number;
|
|
49
48
|
|
|
50
49
|
/**
|
|
@@ -59,7 +58,8 @@ export namespace DynamicBenchmarker {
|
|
|
59
58
|
*
|
|
60
59
|
* The number of requests to be executed simultaneously.
|
|
61
60
|
*
|
|
62
|
-
* This property value would be divided by the {@link threads} in the
|
|
61
|
+
* This property value would be divided by the {@link threads} in the
|
|
62
|
+
* servants.
|
|
63
63
|
*/
|
|
64
64
|
simultaneous: number;
|
|
65
65
|
|
|
@@ -74,8 +74,8 @@ export namespace DynamicBenchmarker {
|
|
|
74
74
|
/**
|
|
75
75
|
* Filter function.
|
|
76
76
|
*
|
|
77
|
-
* The filter function to determine whether to execute the function in
|
|
78
|
-
*
|
|
77
|
+
* The filter function to determine whether to execute the function in the
|
|
78
|
+
* servant or not.
|
|
79
79
|
*
|
|
80
80
|
* @param name Function name
|
|
81
81
|
* @returns Whether to execute the function or not.
|
|
@@ -94,9 +94,9 @@ export namespace DynamicBenchmarker {
|
|
|
94
94
|
*
|
|
95
95
|
* Get the memory usage of the master program.
|
|
96
96
|
*
|
|
97
|
-
* Specify this property only when your backend server is running on
|
|
98
|
-
*
|
|
99
|
-
*
|
|
97
|
+
* Specify this property only when your backend server is running on a
|
|
98
|
+
* different process, so that need to measure the memory usage of the
|
|
99
|
+
* backend server from other process.
|
|
100
100
|
*/
|
|
101
101
|
memory?: () => Promise<NodeJS.MemoryUsage>;
|
|
102
102
|
|
|
@@ -108,9 +108,7 @@ export namespace DynamicBenchmarker {
|
|
|
108
108
|
stdio?: undefined | "overlapped" | "pipe" | "ignore" | "inherit";
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/**
|
|
112
|
-
* Properties of the servant program.
|
|
113
|
-
*/
|
|
111
|
+
/** Properties of the servant program. */
|
|
114
112
|
export interface IServantProps<Parameters extends any[]> {
|
|
115
113
|
/**
|
|
116
114
|
* Default connection.
|
|
@@ -119,9 +117,7 @@ export namespace DynamicBenchmarker {
|
|
|
119
117
|
*/
|
|
120
118
|
connection: IConnection;
|
|
121
119
|
|
|
122
|
-
/**
|
|
123
|
-
* Location of the benchmark functions.
|
|
124
|
-
*/
|
|
120
|
+
/** Location of the benchmark functions. */
|
|
125
121
|
location: string;
|
|
126
122
|
|
|
127
123
|
/**
|
|
@@ -129,8 +125,8 @@ export namespace DynamicBenchmarker {
|
|
|
129
125
|
*
|
|
130
126
|
* Every prefixed function will be executed in the servant.
|
|
131
127
|
*
|
|
132
|
-
* In other words, if a function name doesn't start with the prefix,
|
|
133
|
-
*
|
|
128
|
+
* In other words, if a function name doesn't start with the prefix, then it
|
|
129
|
+
* would never be executed.
|
|
134
130
|
*/
|
|
135
131
|
prefix: string;
|
|
136
132
|
|
|
@@ -138,8 +134,8 @@ export namespace DynamicBenchmarker {
|
|
|
138
134
|
* Get parameters of a function.
|
|
139
135
|
*
|
|
140
136
|
* When composing the parameters, never forget to copy the
|
|
141
|
-
* {@link IConnection.logger} property of default connection to the
|
|
142
|
-
*
|
|
137
|
+
* {@link IConnection.logger} property of default connection to the returning
|
|
138
|
+
* parameters.
|
|
143
139
|
*
|
|
144
140
|
* @param connection Default connection instance
|
|
145
141
|
* @param name Function name
|
|
@@ -147,9 +143,7 @@ export namespace DynamicBenchmarker {
|
|
|
147
143
|
parameters: (connection: IConnection, name: string) => Parameters;
|
|
148
144
|
}
|
|
149
145
|
|
|
150
|
-
/**
|
|
151
|
-
* Benchmark report.
|
|
152
|
-
*/
|
|
146
|
+
/** Benchmark report. */
|
|
153
147
|
export interface IReport {
|
|
154
148
|
count: number;
|
|
155
149
|
threads: number;
|
|
@@ -184,8 +178,8 @@ export namespace DynamicBenchmarker {
|
|
|
184
178
|
*
|
|
185
179
|
* Creates a master program that executing the servant programs in parallel.
|
|
186
180
|
*
|
|
187
|
-
* Note that, {@link IMasterProps.servant} property must be the path of
|
|
188
|
-
*
|
|
181
|
+
* Note that, {@link IMasterProps.servant} property must be the path of the
|
|
182
|
+
* servant program executing the {@link servant} function.
|
|
189
183
|
*
|
|
190
184
|
* @param props Properties of the master program
|
|
191
185
|
* @returns Benchmark report
|