@nestia/benchmark 11.0.0-dev.20260305 → 11.0.0-dev.20260312

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.
@@ -0,0 +1,185 @@
1
+ import { IConnection } from "@nestia/fetcher";
2
+ import { WorkerServer } from "tgrid";
3
+ import { IBenchmarkMaster } from "./internal/IBenchmarkMaster";
4
+ import { IBenchmarkServant } from "./internal/IBenchmarkServant";
5
+ /**
6
+ * Dynamic benchmark executor running prefixed functions.
7
+ *
8
+ * `DynamicBenchmarker` is composed with two programs,
9
+ * {@link DynamicBenchmarker.master} and
10
+ * {@link DynamicBenchmarker.servant servants}. The master program creates
11
+ * multiple servant programs, and the servant programs execute the prefixed
12
+ * functions in parallel. When the pre-congirued count of requests are all
13
+ * completed, the master program collects the results and returns them.
14
+ *
15
+ * Therefore, when you want to benchmark the performance of a backend server,
16
+ * you have to make two programs; one for calling the
17
+ * {@link DynamicBenchmarker.master} function, and the other for calling the
18
+ * {@link DynamicBenchmarker.servant} function. Also, never forget to write the
19
+ * path of the servant program to the
20
+ * {@link DynamicBenchmarker.IMasterProps.servant} property.
21
+ *
22
+ * Also, you when you complete the benchmark execution through the
23
+ * {@link DynamicBenchmarker.master} and {@link DynamicBenchmarker.servant}
24
+ * functions, you can convert the result to markdown content by using the
25
+ * {@link DynamicBenchmarker.markdown} function.
26
+ *
27
+ * Additionally, if you hope to see some utilization cases, see the below
28
+ * example tagged links.
29
+ *
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
36
+ */
37
+ export declare namespace DynamicBenchmarker {
38
+ /** Properties of the master program. */
39
+ interface IMasterProps {
40
+ /** Total count of the requests. */
41
+ count: number;
42
+ /**
43
+ * Number of threads.
44
+ *
45
+ * The number of threads to be executed as parallel servant.
46
+ */
47
+ threads: number;
48
+ /**
49
+ * Number of simultaneous requests.
50
+ *
51
+ * The number of requests to be executed simultaneously.
52
+ *
53
+ * This property value would be divided by the {@link threads} in the
54
+ * servants.
55
+ */
56
+ simultaneous: number;
57
+ /**
58
+ * Path of the servant program.
59
+ *
60
+ * The path of the servant program executing the
61
+ * {@link DynamicBenchmarker.servant} function.
62
+ */
63
+ servant: string;
64
+ /**
65
+ * Filter function.
66
+ *
67
+ * The filter function to determine whether to execute the function in the
68
+ * servant or not.
69
+ *
70
+ * @param name Function name
71
+ * @returns Whether to execute the function or not.
72
+ */
73
+ filter?: (name: string) => boolean;
74
+ /**
75
+ * Progress callback function.
76
+ *
77
+ * @param complete The number of completed requests.
78
+ */
79
+ progress?: (complete: number) => void;
80
+ /**
81
+ * Get memory usage.
82
+ *
83
+ * Get the memory usage of the master program.
84
+ *
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
+ */
89
+ memory?: () => Promise<NodeJS.MemoryUsage>;
90
+ /**
91
+ * Standard I/O option.
92
+ *
93
+ * The standard I/O option for the servant programs.
94
+ */
95
+ stdio?: undefined | "overlapped" | "pipe" | "ignore" | "inherit";
96
+ }
97
+ /** Properties of the servant program. */
98
+ interface IServantProps<Parameters extends any[]> {
99
+ /**
100
+ * Default connection.
101
+ *
102
+ * Default connection to be used in the servant.
103
+ */
104
+ connection: IConnection;
105
+ /** Location of the benchmark functions. */
106
+ location: string;
107
+ /**
108
+ * Prefix of the benchmark functions.
109
+ *
110
+ * Every prefixed function will be executed in the servant.
111
+ *
112
+ * In other words, if a function name doesn't start with the prefix, then it
113
+ * would never be executed.
114
+ */
115
+ prefix: string;
116
+ /**
117
+ * Get parameters of a function.
118
+ *
119
+ * When composing the parameters, never forget to copy the
120
+ * {@link IConnection.logger} property of default connection to the returning
121
+ * parameters.
122
+ *
123
+ * @param connection Default connection instance
124
+ * @param name Function name
125
+ */
126
+ parameters: (connection: IConnection, name: string) => Parameters;
127
+ }
128
+ /** Benchmark report. */
129
+ interface IReport {
130
+ count: number;
131
+ threads: number;
132
+ simultaneous: number;
133
+ started_at: string;
134
+ completed_at: string;
135
+ statistics: IReport.IStatistics;
136
+ endpoints: Array<IReport.IEndpoint & IReport.IStatistics>;
137
+ memories: IReport.IMemory[];
138
+ }
139
+ namespace IReport {
140
+ interface IEndpoint {
141
+ method: string;
142
+ path: string;
143
+ }
144
+ interface IStatistics {
145
+ count: number;
146
+ success: number;
147
+ mean: number | null;
148
+ stdev: number | null;
149
+ minimum: number | null;
150
+ maximum: number | null;
151
+ }
152
+ interface IMemory {
153
+ time: string;
154
+ usage: NodeJS.MemoryUsage;
155
+ }
156
+ }
157
+ /**
158
+ * Master program.
159
+ *
160
+ * Creates a master program that executing the servant programs in parallel.
161
+ *
162
+ * Note that, {@link IMasterProps.servant} property must be the path of the
163
+ * servant program executing the {@link servant} function.
164
+ *
165
+ * @param props Properties of the master program
166
+ * @returns Benchmark report
167
+ */
168
+ const master: (props: IMasterProps) => Promise<IReport>;
169
+ /**
170
+ * Create a servant program.
171
+ *
172
+ * Creates a servant program executing the prefixed functions in parallel.
173
+ *
174
+ * @param props Properties of the servant program
175
+ * @returns Servant program as a worker server
176
+ */
177
+ const servant: <Parameters extends any[]>(props: IServantProps<Parameters>) => Promise<WorkerServer<null, IBenchmarkServant, IBenchmarkMaster>>;
178
+ /**
179
+ * Convert the benchmark report to markdown content.
180
+ *
181
+ * @param report Benchmark report
182
+ * @returns Markdown content
183
+ */
184
+ const markdown: (report: DynamicBenchmarker.IReport) => string;
185
+ }
@@ -0,0 +1,275 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.DynamicBenchmarker = void 0;
49
+ const fs_1 = __importDefault(require("fs"));
50
+ const tgrid_1 = require("tgrid");
51
+ const tstl_1 = require("tstl");
52
+ const DynamicBenchmarkReporter_1 = require("./internal/DynamicBenchmarkReporter");
53
+ /**
54
+ * Dynamic benchmark executor running prefixed functions.
55
+ *
56
+ * `DynamicBenchmarker` is composed with two programs,
57
+ * {@link DynamicBenchmarker.master} and
58
+ * {@link DynamicBenchmarker.servant servants}. The master program creates
59
+ * multiple servant programs, and the servant programs execute the prefixed
60
+ * functions in parallel. When the pre-congirued count of requests are all
61
+ * completed, the master program collects the results and returns them.
62
+ *
63
+ * Therefore, when you want to benchmark the performance of a backend server,
64
+ * you have to make two programs; one for calling the
65
+ * {@link DynamicBenchmarker.master} function, and the other for calling the
66
+ * {@link DynamicBenchmarker.servant} function. Also, never forget to write the
67
+ * path of the servant program to the
68
+ * {@link DynamicBenchmarker.IMasterProps.servant} property.
69
+ *
70
+ * Also, you when you complete the benchmark execution through the
71
+ * {@link DynamicBenchmarker.master} and {@link DynamicBenchmarker.servant}
72
+ * functions, you can convert the result to markdown content by using the
73
+ * {@link DynamicBenchmarker.markdown} function.
74
+ *
75
+ * Additionally, if you hope to see some utilization cases, see the below
76
+ * example tagged links.
77
+ *
78
+ * @author Jeongho Nam - https://github.com/samchon
79
+ * @example
80
+ * https://github.com/samchon/nestia-start/blob/master/test/benchmaark/index.ts
81
+ *
82
+ * @example
83
+ * https://github.com/samchon/backend/blob/master/test/benchmark/index.ts
84
+ */
85
+ var DynamicBenchmarker;
86
+ (function (DynamicBenchmarker) {
87
+ /**
88
+ * Master program.
89
+ *
90
+ * Creates a master program that executing the servant programs in parallel.
91
+ *
92
+ * Note that, {@link IMasterProps.servant} property must be the path of the
93
+ * servant program executing the {@link servant} function.
94
+ *
95
+ * @param props Properties of the master program
96
+ * @returns Benchmark report
97
+ */
98
+ DynamicBenchmarker.master = (props) => __awaiter(this, void 0, void 0, function* () {
99
+ var _a;
100
+ const completes = new Array(props.threads).fill(0);
101
+ const servants = yield Promise.all(new Array(props.threads).fill(null).map((_, i) => __awaiter(this, void 0, void 0, function* () {
102
+ var _a;
103
+ const connector = new tgrid_1.WorkerConnector(null, {
104
+ filter: (_a = props.filter) !== null && _a !== void 0 ? _a : (() => true),
105
+ progress: (current) => {
106
+ completes[i] = current;
107
+ if (props.progress)
108
+ props.progress(completes.reduce((a, b) => a + b, 0));
109
+ },
110
+ }, "process");
111
+ yield connector.connect(props.servant, { stdio: props.stdio });
112
+ return connector;
113
+ })));
114
+ const started_at = new Date();
115
+ const memories = [];
116
+ let completed_at = null;
117
+ (() => __awaiter(this, void 0, void 0, function* () {
118
+ var _a;
119
+ const getter = (_a = props.memory) !== null && _a !== void 0 ? _a : (() => __awaiter(this, void 0, void 0, function* () { return process.memoryUsage(); }));
120
+ while (completed_at === null) {
121
+ yield (0, tstl_1.sleep_for)(1000);
122
+ memories.push({
123
+ usage: yield getter(),
124
+ time: new Date().toISOString(),
125
+ });
126
+ }
127
+ }))().catch(() => { });
128
+ const events = (yield Promise.all(servants.map((connector) => connector.getDriver().execute({
129
+ count: Math.ceil(props.count / props.threads),
130
+ simultaneous: Math.ceil(props.simultaneous / props.threads),
131
+ })))).flat();
132
+ completed_at = new Date();
133
+ yield Promise.all(servants.map((connector) => connector.close()));
134
+ if (props.progress)
135
+ props.progress(props.count);
136
+ const endpoints = new tstl_1.HashMap((key) => (0, tstl_1.hash)(key.method, key.path), (x, y) => x.method === y.method && x.path === y.path);
137
+ for (const e of events)
138
+ endpoints
139
+ .take({
140
+ method: e.metadata.method,
141
+ path: (_a = e.metadata.template) !== null && _a !== void 0 ? _a : e.metadata.path,
142
+ }, () => [])
143
+ .push(e);
144
+ return {
145
+ count: props.count,
146
+ threads: props.threads,
147
+ simultaneous: props.simultaneous,
148
+ statistics: statistics(events),
149
+ endpoints: [...endpoints].map((it) => (Object.assign(Object.assign({}, statistics(it.second)), it.first))),
150
+ started_at: started_at.toISOString(),
151
+ completed_at: completed_at.toISOString(),
152
+ memories,
153
+ };
154
+ });
155
+ /**
156
+ * Create a servant program.
157
+ *
158
+ * Creates a servant program executing the prefixed functions in parallel.
159
+ *
160
+ * @param props Properties of the servant program
161
+ * @returns Servant program as a worker server
162
+ */
163
+ DynamicBenchmarker.servant = (props) => __awaiter(this, void 0, void 0, function* () {
164
+ const server = new tgrid_1.WorkerServer();
165
+ yield server.open({
166
+ execute: execute({
167
+ driver: server.getDriver(),
168
+ props,
169
+ }),
170
+ });
171
+ return server;
172
+ });
173
+ /**
174
+ * Convert the benchmark report to markdown content.
175
+ *
176
+ * @param report Benchmark report
177
+ * @returns Markdown content
178
+ */
179
+ DynamicBenchmarker.markdown = (report) => DynamicBenchmarkReporter_1.DynamicBenchmarkReporter.markdown(report);
180
+ const execute = (ctx) => (mass) => __awaiter(this, void 0, void 0, function* () {
181
+ const functions = [];
182
+ yield iterate({
183
+ collection: functions,
184
+ driver: ctx.driver,
185
+ props: ctx.props,
186
+ })(ctx.props.location);
187
+ const entireEvents = [];
188
+ yield Promise.all(new Array(mass.simultaneous)
189
+ .fill(null)
190
+ .map(() => 1)
191
+ .map(() => __awaiter(this, void 0, void 0, function* () {
192
+ while (entireEvents.length < mass.count) {
193
+ const localEvents = [];
194
+ const func = functions[Math.floor(Math.random() * functions.length)];
195
+ const connection = Object.assign(Object.assign({}, ctx.props.connection), { logger: (fe) => __awaiter(this, void 0, void 0, function* () {
196
+ var _a, _b;
197
+ const be = {
198
+ metadata: fe.route,
199
+ status: fe.status,
200
+ started_at: fe.started_at.toISOString(),
201
+ respond_at: (_b = (_a = fe.respond_at) === null || _a === void 0 ? void 0 : _a.toISOString()) !== null && _b !== void 0 ? _b : null,
202
+ completed_at: fe.completed_at.toISOString(),
203
+ success: true,
204
+ };
205
+ localEvents.push(be);
206
+ entireEvents.push(be);
207
+ }) });
208
+ try {
209
+ yield func.value(...ctx.props.parameters(connection, func.key));
210
+ }
211
+ catch (exp) {
212
+ for (const e of localEvents)
213
+ e.success = e.status === 200 || e.status === 201;
214
+ }
215
+ if (localEvents.length !== 0)
216
+ ctx.driver.progress(entireEvents.length).catch(() => { });
217
+ }
218
+ })));
219
+ yield ctx.driver.progress(entireEvents.length);
220
+ return entireEvents;
221
+ });
222
+ })(DynamicBenchmarker || (exports.DynamicBenchmarker = DynamicBenchmarker = {}));
223
+ const iterate = (ctx) => (path) => __awaiter(void 0, void 0, void 0, function* () {
224
+ const directory = yield fs_1.default.promises.readdir(path);
225
+ for (const file of directory) {
226
+ const location = `${path}/${file}`;
227
+ const stat = yield fs_1.default.promises.stat(location);
228
+ if (stat.isDirectory() === true)
229
+ yield iterate(ctx)(location);
230
+ else if (file.endsWith(__filename.substr(-3)) === true) {
231
+ const modulo = yield Promise.resolve(`${location}`).then(s => __importStar(require(s)));
232
+ for (const [key, value] of Object.entries(modulo)) {
233
+ if (typeof value !== "function")
234
+ continue;
235
+ else if (key.startsWith(ctx.props.prefix) === false)
236
+ continue;
237
+ else if ((yield ctx.driver.filter(key)) === false)
238
+ continue;
239
+ ctx.collection.push({
240
+ key,
241
+ value: value,
242
+ });
243
+ }
244
+ }
245
+ }
246
+ });
247
+ const statistics = (events) => {
248
+ const successes = events.filter((event) => event.success);
249
+ return Object.assign({ count: events.length, success: successes.length }, average(events));
250
+ };
251
+ const average = (events) => {
252
+ if (events.length === 0)
253
+ return {
254
+ mean: null,
255
+ stdev: null,
256
+ minimum: null,
257
+ maximum: null,
258
+ };
259
+ let mean = 0;
260
+ let stdev = 0;
261
+ let minimum = Number.MAX_SAFE_INTEGER;
262
+ let maximum = Number.MIN_SAFE_INTEGER;
263
+ for (const event of events) {
264
+ const elapsed = new Date(event.completed_at).getTime() -
265
+ new Date(event.started_at).getTime();
266
+ mean += elapsed;
267
+ stdev += elapsed * elapsed;
268
+ minimum = Math.min(minimum, elapsed);
269
+ maximum = Math.max(maximum, elapsed);
270
+ }
271
+ mean /= events.length;
272
+ stdev = Math.sqrt(stdev / events.length - mean * mean);
273
+ return { mean, stdev, minimum, maximum };
274
+ };
275
+ //# sourceMappingURL=DynamicBenchmarker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicBenchmarker.js","sourceRoot":"","sources":["../src/DynamicBenchmarker.ts"],"names":[],"mappings":";;;;;;;;;;;;;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C,EAClB;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CACd,MAAyB,EAIzB,EAAE;IACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QACrB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;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;IAC9C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GACX,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;YACtC,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,IAAI,OAAO,CAAC;QAChB,KAAK,IAAI,OAAO,GAAG,OAAO,CAAC;QAC3B,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACrC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,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,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { IFetchRoute } from "@nestia/fetcher";
2
+ export interface IBenchmarkEvent {
3
+ metadata: IFetchRoute<any>;
4
+ status: number | null;
5
+ started_at: string;
6
+ respond_at: string | null;
7
+ completed_at: string;
8
+ success: boolean;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IBenchmarkEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBenchmarkEvent.js","sourceRoot":"","sources":["../src/IBenchmarkEvent.ts"],"names":[],"mappings":""}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./DynamicBenchmarker";
2
+ export * from "./IBenchmarkEvent";
package/lib/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DynamicBenchmarker"), exports);
18
+ __exportStar(require("./IBenchmarkEvent"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,oDAAkC"}
@@ -0,0 +1,4 @@
1
+ import { DynamicBenchmarker } from "../DynamicBenchmarker";
2
+ export declare namespace DynamicBenchmarkReporter {
3
+ const markdown: (report: DynamicBenchmarker.IReport) => string;
4
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DynamicBenchmarkReporter = void 0;
7
+ const os_1 = __importDefault(require("os"));
8
+ var DynamicBenchmarkReporter;
9
+ (function (DynamicBenchmarkReporter) {
10
+ DynamicBenchmarkReporter.markdown = (report) => {
11
+ const format = (value) => value === null ? "N/A" : (Math.floor(value * 100) / 100).toLocaleString();
12
+ const head = () => [
13
+ "Type",
14
+ "Count",
15
+ "Success",
16
+ "Mean.",
17
+ "Stdev.",
18
+ "Minimum",
19
+ "Maximum",
20
+ ].join(" | ") +
21
+ "\n" +
22
+ new Array(7).fill("----").join("|");
23
+ const row = (title, s) => [
24
+ title,
25
+ s.count.toLocaleString(),
26
+ s.success.toLocaleString(),
27
+ format(s.mean),
28
+ format(s.stdev),
29
+ format(s.minimum),
30
+ format(s.maximum),
31
+ ].join(" | ");
32
+ const line = (title, getter) => `line "${title}" [${report.memories.map((m) => Math.floor(getter(m.usage) / 1024 ** 2)).join(", ")}]`;
33
+ return [
34
+ `# Benchmark Report`,
35
+ "> Generated by [`@nestia/benchmark`](https://github.com/samchon/nestia)",
36
+ ``,
37
+ ` - Specifications`,
38
+ ` - CPU: ${os_1.default.cpus()[0].model}`,
39
+ ` - RAM: ${Math.floor(os_1.default.totalmem() / 1024 / 1024 / 1024).toLocaleString()} GB`,
40
+ ` - NodeJS Version: ${process.version}`,
41
+ ` - Backend Server: 1 core / 1 thread`,
42
+ ` - Arguments`,
43
+ ` - Count: ${report.count.toLocaleString()}`,
44
+ ` - Threads: ${report.threads.toLocaleString()}`,
45
+ ` - Simultaneous: ${report.simultaneous.toLocaleString()}`,
46
+ ` - Time`,
47
+ ` - Start: ${report.started_at}`,
48
+ ` - Complete: ${report.completed_at}`,
49
+ ` - Elapsed: ${(new Date(report.completed_at).getTime() - new Date(report.started_at).getTime()).toLocaleString()} ms`,
50
+ ``,
51
+ head(),
52
+ row("Total", report.statistics),
53
+ "",
54
+ "> Unit: milliseconds",
55
+ "",
56
+ "## Memory Consumptions",
57
+ "```mermaid",
58
+ "xychart-beta",
59
+ ` x-axis "Time (second)"`,
60
+ ` y-axis "Memory (MB)"`,
61
+ ` ${line("Resident Set Size", (m) => m.rss)}`,
62
+ ` ${line("Heap Total", (m) => m.heapTotal)}`,
63
+ ` ${line("Heap Used + External", (m) => m.heapUsed + m.external)}`,
64
+ ` ${line("Heap Used Only", (m) => m.heapUsed)}`,
65
+ "```",
66
+ "",
67
+ `> - 🟦 Resident Set Size`,
68
+ `> - 🟢 Heap Total`,
69
+ `> - 🔴 Heap Used + External`,
70
+ `> - 🟡 Heap Used Only`,
71
+ "",
72
+ "## Endpoints",
73
+ head(),
74
+ ...report.endpoints
75
+ .slice()
76
+ .sort((a, b) => { var _a, _b; return ((_a = b.mean) !== null && _a !== void 0 ? _a : 0) - ((_b = a.mean) !== null && _b !== void 0 ? _b : 0); })
77
+ .map((endpoint) => row(`${endpoint.method} ${endpoint.path}`, endpoint)),
78
+ "",
79
+ "> Unit: milliseconds",
80
+ "",
81
+ "## Failures",
82
+ "Method | Path | Count | Failures",
83
+ "-------|------|-------|----------",
84
+ ...report.endpoints
85
+ .filter((e) => e.success !== e.count)
86
+ .slice()
87
+ .sort((a, b) => b.count - a.count)
88
+ .map((e) => [
89
+ e.method,
90
+ e.path,
91
+ e.count.toLocaleString(),
92
+ (e.count - e.success).toLocaleString(),
93
+ ].join(" | ")),
94
+ ].join("\n");
95
+ };
96
+ })(DynamicBenchmarkReporter || (exports.DynamicBenchmarkReporter = DynamicBenchmarkReporter = {}));
97
+ //# sourceMappingURL=DynamicBenchmarkReporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicBenchmarkReporter.js","sourceRoot":"","sources":["../../src/internal/DynamicBenchmarkReporter.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAIpB,IAAiB,wBAAwB,CAmGxC;AAnGD,WAAiB,wBA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AC;IACf,CAAC,CAAC;AACJ,CAAC,EAnGgB,wBAAwB,wCAAxB,wBAAwB,QAmGxC"}
@@ -0,0 +1,4 @@
1
+ export interface IBenchmarkMaster {
2
+ filter: (name: string) => boolean;
3
+ progress: (current: number) => void;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IBenchmarkMaster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBenchmarkMaster.js","sourceRoot":"","sources":["../../src/internal/IBenchmarkMaster.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { IBenchmarkEvent } from "../IBenchmarkEvent";
2
+ export interface IBenchmarkServant {
3
+ execute(props: {
4
+ count: number;
5
+ simultaneous: number;
6
+ }): Promise<IBenchmarkEvent[]>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IBenchmarkServant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBenchmarkServant.js","sourceRoot":"","sources":["../../src/internal/IBenchmarkServant.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/benchmark",
3
- "version": "11.0.0-dev.20260305",
3
+ "version": "11.0.0-dev.20260312",
4
4
  "description": "NestJS Performance Benchmark Program",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "tgrid": "^1.1.0",
32
32
  "tstl": "^3.0.0",
33
- "@nestia/fetcher": "^11.0.0-dev.20260305"
33
+ "@nestia/fetcher": "^11.0.0-dev.20260312"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^25.3.3",
@@ -1,10 +1,10 @@
1
- import { IFetchRoute } from "@nestia/fetcher";
2
-
3
- export interface IBenchmarkEvent {
4
- metadata: IFetchRoute<any>;
5
- status: number | null;
6
- started_at: string;
7
- respond_at: string | null;
8
- completed_at: string;
9
- success: boolean;
10
- }
1
+ import { IFetchRoute } from "@nestia/fetcher";
2
+
3
+ export interface IBenchmarkEvent {
4
+ metadata: IFetchRoute<any>;
5
+ status: number | null;
6
+ started_at: string;
7
+ respond_at: string | null;
8
+ completed_at: string;
9
+ success: boolean;
10
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./DynamicBenchmarker";
2
- export * from "./IBenchmarkEvent";
1
+ export * from "./DynamicBenchmarker";
2
+ export * from "./IBenchmarkEvent";
@@ -1,4 +1,4 @@
1
- export interface IBenchmarkMaster {
2
- filter: (name: string) => boolean;
3
- progress: (current: number) => void;
4
- }
1
+ export interface IBenchmarkMaster {
2
+ filter: (name: string) => boolean;
3
+ progress: (current: number) => void;
4
+ }
@@ -1,8 +1,8 @@
1
- import { IBenchmarkEvent } from "../IBenchmarkEvent";
2
-
3
- export interface IBenchmarkServant {
4
- execute(props: {
5
- count: number;
6
- simultaneous: number;
7
- }): Promise<IBenchmarkEvent[]>;
8
- }
1
+ import { IBenchmarkEvent } from "../IBenchmarkEvent";
2
+
3
+ export interface IBenchmarkServant {
4
+ execute(props: {
5
+ count: number;
6
+ simultaneous: number;
7
+ }): Promise<IBenchmarkEvent[]>;
8
+ }