@nestia/e2e 0.5.0-dev.20240617 → 0.5.0-dev.20240617-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.
|
@@ -3,20 +3,92 @@ import { WorkerServer } from "tgrid";
|
|
|
3
3
|
import { IBenchmarkMaster } from "./structures/IBenchmarkMaster";
|
|
4
4
|
import { IBenchmarkServant } from "./structures/IBenchmarkServant";
|
|
5
5
|
export declare namespace DynamicBenchmarker {
|
|
6
|
+
/**
|
|
7
|
+
* Properties of the master program.
|
|
8
|
+
*/
|
|
6
9
|
interface IMasterProps {
|
|
10
|
+
/**
|
|
11
|
+
* Total count of the requests.
|
|
12
|
+
*/
|
|
7
13
|
count: number;
|
|
14
|
+
/**
|
|
15
|
+
* Number of threads.
|
|
16
|
+
*
|
|
17
|
+
* The number of threads to be executed as parallel servant.
|
|
18
|
+
*/
|
|
8
19
|
threads: number;
|
|
20
|
+
/**
|
|
21
|
+
* Number of simultaneous requests.
|
|
22
|
+
*
|
|
23
|
+
* The number of requests to be executed simultaneously.
|
|
24
|
+
*
|
|
25
|
+
* This property value would be divided by the {@link threads} in the servants.
|
|
26
|
+
*/
|
|
9
27
|
simultaneous: number;
|
|
28
|
+
/**
|
|
29
|
+
* Path of the servant program.
|
|
30
|
+
*
|
|
31
|
+
* The path of the servant program executing the
|
|
32
|
+
* {@link DynamicBenchmarker.servant} function.
|
|
33
|
+
*/
|
|
10
34
|
servant: string;
|
|
35
|
+
/**
|
|
36
|
+
* Filter function.
|
|
37
|
+
*
|
|
38
|
+
* The filter function to determine whether to execute the function in
|
|
39
|
+
* the servant or not.
|
|
40
|
+
*
|
|
41
|
+
* @param name Function name
|
|
42
|
+
* @returns Whether to execute the function or not.
|
|
43
|
+
*/
|
|
11
44
|
filter?: (name: string) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Progress callback function.
|
|
47
|
+
*
|
|
48
|
+
* @param complete The number of completed requests.
|
|
49
|
+
*/
|
|
12
50
|
progress?: (complete: number) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Standard I/O option.
|
|
53
|
+
*
|
|
54
|
+
* The standard I/O option for the servant programs.
|
|
55
|
+
*/
|
|
13
56
|
stdio?: undefined | "overlapped" | "pipe" | "ignore" | "inherit";
|
|
14
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Properties of the servant progrma.
|
|
60
|
+
*/
|
|
15
61
|
interface IServantProps<Parameters extends any[]> {
|
|
62
|
+
/**
|
|
63
|
+
* Default connection.
|
|
64
|
+
*
|
|
65
|
+
* Default connection to be used in the servant.
|
|
66
|
+
*/
|
|
16
67
|
connection: IConnection;
|
|
68
|
+
/**
|
|
69
|
+
* Location of the benchmark functions.
|
|
70
|
+
*/
|
|
17
71
|
location: string;
|
|
72
|
+
/**
|
|
73
|
+
* Prefix of the benchmark functions.
|
|
74
|
+
*
|
|
75
|
+
* Every prefixed function will be executed in the servant.
|
|
76
|
+
*
|
|
77
|
+
* In other words, if a function name doesn't start with the prefix,
|
|
78
|
+
* then it would never be executed.
|
|
79
|
+
*/
|
|
18
80
|
prefix: string;
|
|
19
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Get parameters of a function.
|
|
83
|
+
*
|
|
84
|
+
* When composing the parameters, never forget to copy the
|
|
85
|
+
* {@link IConnection.logger} property of default connection to the
|
|
86
|
+
* returning parameters.
|
|
87
|
+
*
|
|
88
|
+
* @param connection Default connection instance
|
|
89
|
+
* @param name Function name
|
|
90
|
+
*/
|
|
91
|
+
parameters: (connection: IConnection, name: string) => Parameters;
|
|
20
92
|
}
|
|
21
93
|
interface IReport {
|
|
22
94
|
time: number;
|
|
@@ -248,7 +248,7 @@ var DynamicBenchmarker;
|
|
|
248
248
|
_b.label = 1;
|
|
249
249
|
case 1:
|
|
250
250
|
_b.trys.push([1, 3, , 4]);
|
|
251
|
-
return [4 /*yield*/, func.value.apply(func, __spreadArray([], __read(ctx.props.parameters(
|
|
251
|
+
return [4 /*yield*/, func.value.apply(func, __spreadArray([], __read(ctx.props.parameters(ctx.props.connection, func.key)), false))];
|
|
252
252
|
case 2:
|
|
253
253
|
_b.sent();
|
|
254
254
|
current = events.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicBenchmarker.js","sourceRoot":"","sources":["../src/DynamicBenchmarker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AACpB,+BAA8D;AAC9D,6BAAqC;AAMrC,IAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"DynamicBenchmarker.js","sourceRoot":"","sources":["../src/DynamicBenchmarker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AACpB,+BAA8D;AAC9D,6BAAqC;AAMrC,IAAiB,kBAAkB,CA8RlC;AA9RD,WAAiB,kBAAkB;;IAsHpB,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,GAAG,CAAC,UAAO,CAAC;;;;;;wCACxC,SAAS,GAIX,IAAI,uBAAe,CACrB,IAAI,EACJ;4CACE,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;4CACpC,QAAQ,EAAE,UAAC,OAAO;gDAChB,SAAS,CAAC,CAAC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AA;;oBAA5B,SAA4B,CAAC;;;yBACrD,CAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA,EAA7B,yBAA6B;oBACrB,+CAAa,UAAQ,4DAAC;;oBAA/B,MAAM,GAAG,SAAsB;;;;oBACV,oBAAA,SAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA,CAAA;;;;oBAAtC,KAAA,mBAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;yBAChB,CAAA,OAAO,KAAK,KAAK,UAAU,CAAA,EAA3B,yBAA2B;oBAAE,yBAAS;;yBACjC,CAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,KAAK,CAAA,EAA1C,yBAA0C;oBAAE,yBAAS;yBACpD,qBAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAA;;oBAAjC,IAAI,CAAC,SAA4B,CAAC,KAAK,KAAK;wBAAE,yBAAS;;;oBAC5D,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;wBAClB,GAAG,KAAA;wBACH,KAAK,EAAE,KAA8C;qBACtD,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIV;AAnBD,CAmBC,CAAC"}
|
package/package.json
CHANGED
|
@@ -8,20 +8,102 @@ import { IBenchmarkMaster } from "./structures/IBenchmarkMaster";
|
|
|
8
8
|
import { IBenchmarkServant } from "./structures/IBenchmarkServant";
|
|
9
9
|
|
|
10
10
|
export namespace DynamicBenchmarker {
|
|
11
|
+
/**
|
|
12
|
+
* Properties of the master program.
|
|
13
|
+
*/
|
|
11
14
|
export interface IMasterProps {
|
|
15
|
+
/**
|
|
16
|
+
* Total count of the requests.
|
|
17
|
+
*/
|
|
12
18
|
count: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Number of threads.
|
|
22
|
+
*
|
|
23
|
+
* The number of threads to be executed as parallel servant.
|
|
24
|
+
*/
|
|
13
25
|
threads: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Number of simultaneous requests.
|
|
29
|
+
*
|
|
30
|
+
* The number of requests to be executed simultaneously.
|
|
31
|
+
*
|
|
32
|
+
* This property value would be divided by the {@link threads} in the servants.
|
|
33
|
+
*/
|
|
14
34
|
simultaneous: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Path of the servant program.
|
|
38
|
+
*
|
|
39
|
+
* The path of the servant program executing the
|
|
40
|
+
* {@link DynamicBenchmarker.servant} function.
|
|
41
|
+
*/
|
|
15
42
|
servant: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Filter function.
|
|
46
|
+
*
|
|
47
|
+
* The filter function to determine whether to execute the function in
|
|
48
|
+
* the servant or not.
|
|
49
|
+
*
|
|
50
|
+
* @param name Function name
|
|
51
|
+
* @returns Whether to execute the function or not.
|
|
52
|
+
*/
|
|
16
53
|
filter?: (name: string) => boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Progress callback function.
|
|
57
|
+
*
|
|
58
|
+
* @param complete The number of completed requests.
|
|
59
|
+
*/
|
|
17
60
|
progress?: (complete: number) => void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Standard I/O option.
|
|
64
|
+
*
|
|
65
|
+
* The standard I/O option for the servant programs.
|
|
66
|
+
*/
|
|
18
67
|
stdio?: undefined | "overlapped" | "pipe" | "ignore" | "inherit";
|
|
19
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Properties of the servant progrma.
|
|
72
|
+
*/
|
|
20
73
|
export interface IServantProps<Parameters extends any[]> {
|
|
74
|
+
/**
|
|
75
|
+
* Default connection.
|
|
76
|
+
*
|
|
77
|
+
* Default connection to be used in the servant.
|
|
78
|
+
*/
|
|
21
79
|
connection: IConnection;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Location of the benchmark functions.
|
|
83
|
+
*/
|
|
22
84
|
location: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Prefix of the benchmark functions.
|
|
88
|
+
*
|
|
89
|
+
* Every prefixed function will be executed in the servant.
|
|
90
|
+
*
|
|
91
|
+
* In other words, if a function name doesn't start with the prefix,
|
|
92
|
+
* then it would never be executed.
|
|
93
|
+
*/
|
|
23
94
|
prefix: string;
|
|
24
|
-
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get parameters of a function.
|
|
98
|
+
*
|
|
99
|
+
* When composing the parameters, never forget to copy the
|
|
100
|
+
* {@link IConnection.logger} property of default connection to the
|
|
101
|
+
* returning parameters.
|
|
102
|
+
*
|
|
103
|
+
* @param connection Default connection instance
|
|
104
|
+
* @param name Function name
|
|
105
|
+
*/
|
|
106
|
+
parameters: (connection: IConnection, name: string) => Parameters;
|
|
25
107
|
}
|
|
26
108
|
export interface IReport {
|
|
27
109
|
time: number;
|
|
@@ -160,7 +242,7 @@ export namespace DynamicBenchmarker {
|
|
|
160
242
|
functions[Math.floor(Math.random() * functions.length)];
|
|
161
243
|
try {
|
|
162
244
|
await func.value(
|
|
163
|
-
...ctx.props.parameters(
|
|
245
|
+
...ctx.props.parameters(ctx.props.connection, func.key),
|
|
164
246
|
);
|
|
165
247
|
const current: number = events.length;
|
|
166
248
|
if (current !== prev)
|