@code-pushup/utils 0.111.0 → 0.112.0
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.
- package/package.json +10 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/exit-process.d.ts +11 -1
- package/src/lib/exit-process.js +35 -11
- package/src/lib/exit-process.js.map +1 -1
- package/src/lib/nx.d.ts +6 -0
- package/src/lib/nx.js +17 -0
- package/src/lib/nx.js.map +1 -0
- package/src/lib/profiler/constants.d.ts +8 -4
- package/src/lib/profiler/constants.js +8 -4
- package/src/lib/profiler/constants.js.map +1 -1
- package/src/lib/profiler/profiler-node.d.ts +101 -0
- package/src/lib/profiler/profiler-node.js +217 -0
- package/src/lib/profiler/profiler-node.js.map +1 -0
- package/src/lib/profiler/profiler.d.ts +0 -82
- package/src/lib/profiler/profiler.js +1 -142
- package/src/lib/profiler/profiler.js.map +1 -1
- package/src/lib/wal.d.ts +18 -2
- package/src/lib/wal.js +30 -3
- package/src/lib/wal.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.0",
|
|
4
4
|
"description": "Low-level utilities (helper functions, etc.) used by Code PushUp CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/utils#readme",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"node": ">=18.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@code-pushup/models": "0.
|
|
30
|
+
"@code-pushup/models": "0.112.0",
|
|
31
31
|
"ansis": "^3.3.0",
|
|
32
32
|
"build-md": "^0.4.2",
|
|
33
33
|
"bundle-require": "^5.1.0",
|
|
@@ -39,6 +39,14 @@
|
|
|
39
39
|
"wrap-ansi": "^9.0.2",
|
|
40
40
|
"zod": "^4.2.1"
|
|
41
41
|
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@nx/devkit": ">=17.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@nx/devkit": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
42
50
|
"files": [
|
|
43
51
|
"src",
|
|
44
52
|
"!**/*.tsbuildinfo"
|
package/src/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { hasNoNullableProps, isPromiseFulfilledResult, isPromiseRejectedResult,
|
|
|
17
17
|
export { interpolate } from './lib/interpolate.js';
|
|
18
18
|
export { Logger, logger } from './lib/logger.js';
|
|
19
19
|
export { mergeConfigs } from './lib/merge-configs.js';
|
|
20
|
+
export { loadNxProjectGraph } from './lib/nx.js';
|
|
20
21
|
export { addIndex, expandAuditsForUrls, expandCategoryRefs, expandGroupsForUrls, extractGroupSlugs, shouldExpandForUrls, } from './lib/plugin-url-aggregation.js';
|
|
21
22
|
export { getUrlIdentifier, normalizeUrlInput, pluginUrlContextSchema, type PluginUrlContext, } from './lib/plugin-url-config.js';
|
|
22
23
|
export { asyncSequential, groupByStatus, settlePromise, } from './lib/promises.js';
|
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { hasNoNullableProps, isPromiseFulfilledResult, isPromiseRejectedResult,
|
|
|
17
17
|
export { interpolate } from './lib/interpolate.js';
|
|
18
18
|
export { Logger, logger } from './lib/logger.js';
|
|
19
19
|
export { mergeConfigs } from './lib/merge-configs.js';
|
|
20
|
+
export { loadNxProjectGraph } from './lib/nx.js';
|
|
20
21
|
export { addIndex, expandAuditsForUrls, expandCategoryRefs, expandGroupsForUrls, extractGroupSlugs, shouldExpandForUrls, } from './lib/plugin-url-aggregation.js';
|
|
21
22
|
export { getUrlIdentifier, normalizeUrlInput, pluginUrlContextSchema, } from './lib/plugin-url-config.js';
|
|
22
23
|
export { asyncSequential, groupByStatus, settlePromise, } from './lib/promises.js';
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EACX,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,mBAAmB,EAEnB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAa,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,YAAY,GAIb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,aAAa,GAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,SAAS,EACT,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,OAAO,EACP,cAAc,E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MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,4BAA4B,EAC5B,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,UAAU,GAEX,MAAM,oBAAoB,CAAC"}
|
|
@@ -18,4 +18,14 @@ export type ExitHandlerOptions = {
|
|
|
18
18
|
exitOnSignal?: boolean;
|
|
19
19
|
fatalExitCode?: number;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param options - Options for the exit handler
|
|
24
|
+
* @param options.onExit - Callback to be called when the process exits
|
|
25
|
+
* @param options.onError - Callback to be called when an error occurs
|
|
26
|
+
* @param options.exitOnFatal - Whether to exit the process on fatal errors
|
|
27
|
+
* @param options.exitOnSignal - Whether to exit the process on signals
|
|
28
|
+
* @param options.fatalExitCode - The exit code to use for fatal errors
|
|
29
|
+
* @returns A function to unsubscribe from the exit handlers
|
|
30
|
+
*/
|
|
31
|
+
export declare function subscribeProcessExit(options?: ExitHandlerOptions): () => void;
|
package/src/lib/exit-process.js
CHANGED
|
@@ -16,7 +16,18 @@ export const SIGNAL_EXIT_CODES = () => {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
export const DEFAULT_FATAL_EXIT_CODE = 1;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param options - Options for the exit handler
|
|
22
|
+
* @param options.onExit - Callback to be called when the process exits
|
|
23
|
+
* @param options.onError - Callback to be called when an error occurs
|
|
24
|
+
* @param options.exitOnFatal - Whether to exit the process on fatal errors
|
|
25
|
+
* @param options.exitOnSignal - Whether to exit the process on signals
|
|
26
|
+
* @param options.fatalExitCode - The exit code to use for fatal errors
|
|
27
|
+
* @returns A function to unsubscribe from the exit handlers
|
|
28
|
+
*/
|
|
29
|
+
// eslint-disable-next-line max-lines-per-function
|
|
30
|
+
export function subscribeProcessExit(options = {}) {
|
|
20
31
|
// eslint-disable-next-line functional/no-let
|
|
21
32
|
let closedReason;
|
|
22
33
|
const { onExit, onError, exitOnFatal = false, exitOnSignal = false, fatalExitCode = DEFAULT_FATAL_EXIT_CODE, } = options;
|
|
@@ -27,7 +38,7 @@ export function installExitHandlers(options = {}) {
|
|
|
27
38
|
closedReason = reason;
|
|
28
39
|
onExit?.(code, reason);
|
|
29
40
|
};
|
|
30
|
-
|
|
41
|
+
const uncaughtExceptionHandler = (err) => {
|
|
31
42
|
onError?.(err, 'uncaughtException');
|
|
32
43
|
if (exitOnFatal) {
|
|
33
44
|
close(fatalExitCode, {
|
|
@@ -35,8 +46,8 @@ export function installExitHandlers(options = {}) {
|
|
|
35
46
|
fatal: 'uncaughtException',
|
|
36
47
|
});
|
|
37
48
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
49
|
+
};
|
|
50
|
+
const unhandledRejectionHandler = (reason) => {
|
|
40
51
|
onError?.(reason, 'unhandledRejection');
|
|
41
52
|
if (exitOnFatal) {
|
|
42
53
|
close(fatalExitCode, {
|
|
@@ -44,21 +55,34 @@ export function installExitHandlers(options = {}) {
|
|
|
44
55
|
fatal: 'unhandledRejection',
|
|
45
56
|
});
|
|
46
57
|
}
|
|
47
|
-
}
|
|
48
|
-
['SIGINT', 'SIGTERM', 'SIGQUIT'].
|
|
49
|
-
|
|
58
|
+
};
|
|
59
|
+
const signalHandlers = ['SIGINT', 'SIGTERM', 'SIGQUIT'].map(signal => {
|
|
60
|
+
const handler = () => {
|
|
50
61
|
close(SIGNAL_EXIT_CODES()[signal], { kind: 'signal', signal });
|
|
51
62
|
if (exitOnSignal) {
|
|
52
|
-
// eslint-disable-next-line n/no-process-exit
|
|
63
|
+
// eslint-disable-next-line unicorn/no-process-exit,n/no-process-exit
|
|
53
64
|
process.exit(SIGNAL_EXIT_CODES()[signal]);
|
|
54
65
|
}
|
|
55
|
-
}
|
|
66
|
+
};
|
|
67
|
+
process.on(signal, handler);
|
|
68
|
+
return { signal, handler };
|
|
56
69
|
});
|
|
57
|
-
|
|
70
|
+
const exitHandler = (code) => {
|
|
58
71
|
if (closedReason) {
|
|
59
72
|
return;
|
|
60
73
|
}
|
|
61
74
|
close(code, { kind: 'exit' });
|
|
62
|
-
}
|
|
75
|
+
};
|
|
76
|
+
process.on('uncaughtException', uncaughtExceptionHandler);
|
|
77
|
+
process.on('unhandledRejection', unhandledRejectionHandler);
|
|
78
|
+
process.on('exit', exitHandler);
|
|
79
|
+
return () => {
|
|
80
|
+
process.removeListener('uncaughtException', uncaughtExceptionHandler);
|
|
81
|
+
process.removeListener('unhandledRejection', unhandledRejectionHandler);
|
|
82
|
+
process.removeListener('exit', exitHandler);
|
|
83
|
+
signalHandlers.forEach(({ signal, handler }) => {
|
|
84
|
+
process.removeListener(signal, handler);
|
|
85
|
+
});
|
|
86
|
+
};
|
|
63
87
|
}
|
|
64
88
|
//# sourceMappingURL=exit-process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-process.js","sourceRoot":"","sources":["../../../src/lib/exit-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,6DAA6D;AAC7D,uOAAuO;AACvO,MAAM,4BAA4B,GAAG,GAAG,CAAC;AACzC,MAAM,kBAAkB,GAAG,CAAC,YAAoB,EAAE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CAAC,CAAC;AACJ,CAAC"}
|
package/src/lib/nx.d.ts
ADDED
package/src/lib/nx.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { stringifyError } from './errors.js';
|
|
2
|
+
import { logger } from './logger.js';
|
|
3
|
+
/**
|
|
4
|
+
* Loads the Nx project graph for the current workspace.
|
|
5
|
+
* Tries to read from cache first, falls back to async creation.
|
|
6
|
+
*/
|
|
7
|
+
export async function loadNxProjectGraph() {
|
|
8
|
+
const { readCachedProjectGraph, createProjectGraphAsync } = await import('@nx/devkit');
|
|
9
|
+
try {
|
|
10
|
+
return readCachedProjectGraph();
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
logger.warn(`Could not read cached project graph, falling back to async creation.\n${stringifyError(error)}`);
|
|
14
|
+
return createProjectGraphAsync({ exitOnError: false });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=nx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx.js","sourceRoot":"","sources":["../../../src/lib/nx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,GAAG,MAAM,MAAM,CACtE,YAAY,CACb,CAAC;IACF,IAAI,CAAC;QACH,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CACT,yEAAyE,cAAc,CAAC,KAAK,CAAC,EAAE,CACjG,CAAC;QACF,OAAO,uBAAuB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* When set to 'true', profiling is enabled. When set to 'false' or unset, profiling is disabled.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
|
-
* ```bash
|
|
7
6
|
* CP_PROFILING=true npm run dev
|
|
8
|
-
* ```
|
|
9
7
|
*/
|
|
10
8
|
export declare const PROFILER_ENABLED_ENV_VAR = "CP_PROFILING";
|
|
11
9
|
/**
|
|
@@ -13,8 +11,14 @@ export declare const PROFILER_ENABLED_ENV_VAR = "CP_PROFILING";
|
|
|
13
11
|
* When set to 'true', profiler state transitions create performance marks for debugging.
|
|
14
12
|
*
|
|
15
13
|
* @example
|
|
16
|
-
* ```bash
|
|
17
14
|
* CP_PROFILER_DEBUG=true npm run dev
|
|
18
|
-
* ```
|
|
19
15
|
*/
|
|
20
16
|
export declare const PROFILER_DEBUG_ENV_VAR = "CP_PROFILER_DEBUG";
|
|
17
|
+
/**
|
|
18
|
+
* Environment variable name for setting the Sharded WAL Coordinator ID.
|
|
19
|
+
* This ID is used to identify the coordinator instance in a sharded Write-Ahead Logging setup.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* CP_SHARDED_WAL_COORDINATOR_ID=coordinator-1 npm run dev
|
|
23
|
+
*/
|
|
24
|
+
export declare const SHARDED_WAL_COORDINATOR_ID_ENV_VAR = "CP_SHARDED_WAL_COORDINATOR_ID";
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* When set to 'true', profiling is enabled. When set to 'false' or unset, profiling is disabled.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
|
-
* ```bash
|
|
7
6
|
* CP_PROFILING=true npm run dev
|
|
8
|
-
* ```
|
|
9
7
|
*/
|
|
10
8
|
export const PROFILER_ENABLED_ENV_VAR = 'CP_PROFILING';
|
|
11
9
|
/**
|
|
@@ -13,9 +11,15 @@ export const PROFILER_ENABLED_ENV_VAR = 'CP_PROFILING';
|
|
|
13
11
|
* When set to 'true', profiler state transitions create performance marks for debugging.
|
|
14
12
|
*
|
|
15
13
|
* @example
|
|
16
|
-
* ```bash
|
|
17
14
|
* CP_PROFILER_DEBUG=true npm run dev
|
|
18
|
-
* ```
|
|
19
15
|
*/
|
|
20
16
|
export const PROFILER_DEBUG_ENV_VAR = 'CP_PROFILER_DEBUG';
|
|
17
|
+
/**
|
|
18
|
+
* Environment variable name for setting the Sharded WAL Coordinator ID.
|
|
19
|
+
* This ID is used to identify the coordinator instance in a sharded Write-Ahead Logging setup.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* CP_SHARDED_WAL_COORDINATOR_ID=coordinator-1 npm run dev
|
|
23
|
+
*/
|
|
24
|
+
export const SHARDED_WAL_COORDINATOR_ID_ENV_VAR = 'CP_SHARDED_WAL_COORDINATOR_ID';
|
|
21
25
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/profiler/constants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/profiler/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type PerformanceObserverOptions } from '../performance-observer.js';
|
|
2
|
+
import type { ActionTrackEntryPayload } from '../user-timing-extensibility-api.type.js';
|
|
3
|
+
import { Profiler, type ProfilerOptions } from './profiler.js';
|
|
4
|
+
/**
|
|
5
|
+
* Options for configuring a NodejsProfiler instance.
|
|
6
|
+
*
|
|
7
|
+
* Extends ProfilerOptions with a required sink parameter.
|
|
8
|
+
*
|
|
9
|
+
* @template Tracks - Record type defining available track names and their configurations
|
|
10
|
+
*/
|
|
11
|
+
export type NodejsProfilerOptions<DomainEvents extends string | object, Tracks extends Record<string, ActionTrackEntryPayload>> = ProfilerOptions<Tracks> & Omit<PerformanceObserverOptions<DomainEvents>, 'sink'> & {
|
|
12
|
+
/**
|
|
13
|
+
* File path for the WriteAheadLogFile sink.
|
|
14
|
+
* If not provided, defaults to `trace.json` in the current working directory.
|
|
15
|
+
*
|
|
16
|
+
* @default path.join(process.cwd(), 'trace.json')
|
|
17
|
+
*/
|
|
18
|
+
filename?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Name of the environment variable to check for debug mode.
|
|
21
|
+
* When the env var is set to 'true', profiler state transitions create performance marks for debugging.
|
|
22
|
+
*
|
|
23
|
+
* @default 'CP_PROFILER_DEBUG'
|
|
24
|
+
*/
|
|
25
|
+
debugEnvVar?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Performance profiler with automatic process exit handling for buffered performance data.
|
|
29
|
+
*
|
|
30
|
+
* This class extends the base {@link Profiler} with automatic flushing of performance data
|
|
31
|
+
* when the process exits. It automatically creates a {@link WriteAheadLogFile} sink that buffers
|
|
32
|
+
* performance entries and ensures they are written out during process termination, even for unexpected exits.
|
|
33
|
+
*
|
|
34
|
+
* The sink uses a default codec for serializing performance data to JSON format,
|
|
35
|
+
* enabling compatibility with Chrome DevTools trace file format.
|
|
36
|
+
*
|
|
37
|
+
* The profiler automatically subscribes to the performance observer when enabled and installs
|
|
38
|
+
* exit handlers that flush buffered data on process termination (signals, fatal errors, or normal exit).
|
|
39
|
+
*
|
|
40
|
+
* @template DomainEvents - The type of domain-specific events encoded by the performance observer sink
|
|
41
|
+
* @template Tracks - Record type defining available track names and their configurations
|
|
42
|
+
*/
|
|
43
|
+
export declare class NodejsProfiler<DomainEvents extends string | object, Tracks extends Record<string, ActionTrackEntryPayload> = Record<string, ActionTrackEntryPayload>> extends Profiler<Tracks> {
|
|
44
|
+
#private;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a NodejsProfiler instance.
|
|
47
|
+
* A WriteAheadLogFile sink is automatically created for buffering performance data.
|
|
48
|
+
* @param options - Configuration options
|
|
49
|
+
*/
|
|
50
|
+
constructor(options: NodejsProfilerOptions<DomainEvents, Tracks>);
|
|
51
|
+
/**
|
|
52
|
+
* Returns whether debug mode is enabled for profiler state transitions.
|
|
53
|
+
*
|
|
54
|
+
* Debug mode is initially determined by the environment variable specified by `debugEnvVar`
|
|
55
|
+
* (defaults to 'CP_PROFILER_DEBUG') during construction, but can be changed at runtime
|
|
56
|
+
* using {@link setDebugMode}. When enabled, profiler state transitions create
|
|
57
|
+
* performance marks for debugging.
|
|
58
|
+
*
|
|
59
|
+
* @returns true if debug mode is enabled, false otherwise
|
|
60
|
+
*/
|
|
61
|
+
get debug(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Sets debug mode for profiler state transitions.
|
|
64
|
+
*
|
|
65
|
+
* When debug mode is enabled, profiler state transitions create performance marks
|
|
66
|
+
* for debugging. This allows runtime control of debug mode without needing to
|
|
67
|
+
* restart the application or change environment variables.
|
|
68
|
+
*
|
|
69
|
+
* @param enabled - Whether to enable debug mode
|
|
70
|
+
*/
|
|
71
|
+
setDebugMode(enabled: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* Closes profiler and releases resources. Idempotent, safe for exit handlers.
|
|
74
|
+
* **Exit Handler Usage**: Call only this method from process exit handlers.
|
|
75
|
+
*/
|
|
76
|
+
close(): void;
|
|
77
|
+
/** @returns Current profiler state */
|
|
78
|
+
get state(): 'idle' | 'running' | 'closed';
|
|
79
|
+
/** @returns Whether profiler is in 'running' state */
|
|
80
|
+
isEnabled(): boolean;
|
|
81
|
+
/** Enables profiling (start/stop) */
|
|
82
|
+
setEnabled(enabled: boolean): void;
|
|
83
|
+
/** @returns Queue statistics and profiling state for monitoring */
|
|
84
|
+
get stats(): {
|
|
85
|
+
debug: boolean;
|
|
86
|
+
state: "idle" | "running" | "closed";
|
|
87
|
+
walOpen: boolean;
|
|
88
|
+
isSubscribed: boolean;
|
|
89
|
+
queued: number;
|
|
90
|
+
dropped: number;
|
|
91
|
+
written: number;
|
|
92
|
+
maxQueueSize: number;
|
|
93
|
+
flushThreshold: number;
|
|
94
|
+
addedSinceLastFlush: number;
|
|
95
|
+
buffered: boolean;
|
|
96
|
+
};
|
|
97
|
+
/** Flushes buffered performance data to sink. */
|
|
98
|
+
flush(): void;
|
|
99
|
+
/** @returns The file path of the WriteAheadLogFile sink */
|
|
100
|
+
get filePath(): string;
|
|
101
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { isEnvVarEnabled } from '../env.js';
|
|
3
|
+
import { subscribeProcessExit } from '../exit-process.js';
|
|
4
|
+
import { PerformanceObserverSink, } from '../performance-observer.js';
|
|
5
|
+
import { objectToEntries } from '../transform.js';
|
|
6
|
+
import { errorToMarkerPayload } from '../user-timing-extensibility-api-utils.js';
|
|
7
|
+
import { WriteAheadLogFile, getShardId, getShardedGroupId, getShardedPath, } from '../wal.js';
|
|
8
|
+
import { PROFILER_DEBUG_ENV_VAR, PROFILER_ENABLED_ENV_VAR, } from './constants.js';
|
|
9
|
+
import { Profiler } from './profiler.js';
|
|
10
|
+
import { traceEventWalFormat } from './wal-json-trace.js';
|
|
11
|
+
/**
|
|
12
|
+
* Performance profiler with automatic process exit handling for buffered performance data.
|
|
13
|
+
*
|
|
14
|
+
* This class extends the base {@link Profiler} with automatic flushing of performance data
|
|
15
|
+
* when the process exits. It automatically creates a {@link WriteAheadLogFile} sink that buffers
|
|
16
|
+
* performance entries and ensures they are written out during process termination, even for unexpected exits.
|
|
17
|
+
*
|
|
18
|
+
* The sink uses a default codec for serializing performance data to JSON format,
|
|
19
|
+
* enabling compatibility with Chrome DevTools trace file format.
|
|
20
|
+
*
|
|
21
|
+
* The profiler automatically subscribes to the performance observer when enabled and installs
|
|
22
|
+
* exit handlers that flush buffered data on process termination (signals, fatal errors, or normal exit).
|
|
23
|
+
*
|
|
24
|
+
* @template DomainEvents - The type of domain-specific events encoded by the performance observer sink
|
|
25
|
+
* @template Tracks - Record type defining available track names and their configurations
|
|
26
|
+
*/
|
|
27
|
+
export class NodejsProfiler extends Profiler {
|
|
28
|
+
#sink;
|
|
29
|
+
#performanceObserverSink;
|
|
30
|
+
#state = 'idle';
|
|
31
|
+
#debug;
|
|
32
|
+
#unsubscribeExitHandlers;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a NodejsProfiler instance.
|
|
35
|
+
* A WriteAheadLogFile sink is automatically created for buffering performance data.
|
|
36
|
+
* @param options - Configuration options
|
|
37
|
+
*/
|
|
38
|
+
// eslint-disable-next-line max-lines-per-function
|
|
39
|
+
constructor(options) {
|
|
40
|
+
const { encodePerfEntry, captureBufferedEntries, flushThreshold, maxQueueSize, enabled, filename, debugEnvVar = PROFILER_DEBUG_ENV_VAR, ...profilerOptions } = options;
|
|
41
|
+
const initialEnabled = enabled ?? isEnvVarEnabled(PROFILER_ENABLED_ENV_VAR);
|
|
42
|
+
super({ ...profilerOptions, enabled: initialEnabled });
|
|
43
|
+
const walFormat = traceEventWalFormat();
|
|
44
|
+
this.#sink = new WriteAheadLogFile({
|
|
45
|
+
file: filename ??
|
|
46
|
+
path.join(process.cwd(), getShardedPath({
|
|
47
|
+
dir: 'tmp/profiles',
|
|
48
|
+
groupId: getShardedGroupId(),
|
|
49
|
+
shardId: getShardId(),
|
|
50
|
+
format: walFormat,
|
|
51
|
+
})),
|
|
52
|
+
codec: walFormat.codec,
|
|
53
|
+
});
|
|
54
|
+
this.#debug = isEnvVarEnabled(debugEnvVar);
|
|
55
|
+
this.#performanceObserverSink = new PerformanceObserverSink({
|
|
56
|
+
sink: this.#sink,
|
|
57
|
+
encodePerfEntry,
|
|
58
|
+
captureBufferedEntries,
|
|
59
|
+
flushThreshold,
|
|
60
|
+
maxQueueSize,
|
|
61
|
+
debugEnvVar,
|
|
62
|
+
});
|
|
63
|
+
this.#unsubscribeExitHandlers = subscribeProcessExit({
|
|
64
|
+
onError: (error, kind) => {
|
|
65
|
+
this.#handleFatalError(error, kind);
|
|
66
|
+
},
|
|
67
|
+
onExit: (_code) => {
|
|
68
|
+
this.close();
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
if (initialEnabled) {
|
|
72
|
+
this.#transition('running');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns whether debug mode is enabled for profiler state transitions.
|
|
77
|
+
*
|
|
78
|
+
* Debug mode is initially determined by the environment variable specified by `debugEnvVar`
|
|
79
|
+
* (defaults to 'CP_PROFILER_DEBUG') during construction, but can be changed at runtime
|
|
80
|
+
* using {@link setDebugMode}. When enabled, profiler state transitions create
|
|
81
|
+
* performance marks for debugging.
|
|
82
|
+
*
|
|
83
|
+
* @returns true if debug mode is enabled, false otherwise
|
|
84
|
+
*/
|
|
85
|
+
get debug() {
|
|
86
|
+
return this.#debug;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sets debug mode for profiler state transitions.
|
|
90
|
+
*
|
|
91
|
+
* When debug mode is enabled, profiler state transitions create performance marks
|
|
92
|
+
* for debugging. This allows runtime control of debug mode without needing to
|
|
93
|
+
* restart the application or change environment variables.
|
|
94
|
+
*
|
|
95
|
+
* @param enabled - Whether to enable debug mode
|
|
96
|
+
*/
|
|
97
|
+
setDebugMode(enabled) {
|
|
98
|
+
this.#debug = enabled;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Creates a performance marker for a profiler state transition.
|
|
102
|
+
* @param transition - The state transition that occurred
|
|
103
|
+
*/
|
|
104
|
+
#transitionMarker(transition) {
|
|
105
|
+
const transitionMarkerPayload = {
|
|
106
|
+
dataType: 'marker',
|
|
107
|
+
color: 'primary',
|
|
108
|
+
tooltipText: `Profiler state transition: ${transition}`,
|
|
109
|
+
properties: [['Transition', transition], ...objectToEntries(this.stats)],
|
|
110
|
+
};
|
|
111
|
+
this.marker(transition, transitionMarkerPayload);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Handles fatal errors by marking them and shutting down the profiler.
|
|
115
|
+
* @param error - The error that occurred
|
|
116
|
+
* @param kind - The kind of fatal error (uncaughtException or unhandledRejection)
|
|
117
|
+
*/
|
|
118
|
+
#handleFatalError(error, kind) {
|
|
119
|
+
this.marker('Fatal Error', errorToMarkerPayload(error, {
|
|
120
|
+
tooltipText: `${kind} caused fatal error`,
|
|
121
|
+
}));
|
|
122
|
+
this.close(); // Ensures buffers flush and sink finalizes
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Transitions the profiler to a new state, performing necessary setup/teardown operations.
|
|
126
|
+
*
|
|
127
|
+
* State transitions enforce lifecycle invariants:
|
|
128
|
+
* - `idle -> running`: Enables profiling, opens sink, and subscribes to performance observer
|
|
129
|
+
* - `running -> idle`: Disables profiling, unsubscribes, and closes sink (sink will be reopened on re-enable)
|
|
130
|
+
* - `running -> closed`: Disables profiling, unsubscribes, and closes sink (irreversible)
|
|
131
|
+
* - `idle -> closed`: Closes sink if it was opened (irreversible)
|
|
132
|
+
*
|
|
133
|
+
* @param next - The target state to transition to
|
|
134
|
+
* @throws {Error} If attempting to transition from 'closed' state or invalid transition
|
|
135
|
+
*/
|
|
136
|
+
#transition(next) {
|
|
137
|
+
if (this.#state === next) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (this.#state === 'closed') {
|
|
141
|
+
throw new Error('Profiler already closed');
|
|
142
|
+
}
|
|
143
|
+
const transition = `${this.#state}->${next}`;
|
|
144
|
+
switch (transition) {
|
|
145
|
+
case 'idle->running':
|
|
146
|
+
super.setEnabled(true);
|
|
147
|
+
this.#sink.open?.();
|
|
148
|
+
this.#performanceObserverSink.subscribe();
|
|
149
|
+
break;
|
|
150
|
+
case 'running->idle':
|
|
151
|
+
case 'running->closed':
|
|
152
|
+
super.setEnabled(false);
|
|
153
|
+
this.#performanceObserverSink.unsubscribe();
|
|
154
|
+
this.#sink.close?.();
|
|
155
|
+
break;
|
|
156
|
+
case 'idle->closed':
|
|
157
|
+
// Sink may have been opened before, close it
|
|
158
|
+
this.#sink.close?.();
|
|
159
|
+
break;
|
|
160
|
+
default:
|
|
161
|
+
throw new Error(`Invalid transition: ${this.#state} -> ${next}`);
|
|
162
|
+
}
|
|
163
|
+
this.#state = next;
|
|
164
|
+
if (this.#debug) {
|
|
165
|
+
this.#transitionMarker(transition);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Closes profiler and releases resources. Idempotent, safe for exit handlers.
|
|
170
|
+
* **Exit Handler Usage**: Call only this method from process exit handlers.
|
|
171
|
+
*/
|
|
172
|
+
close() {
|
|
173
|
+
if (this.#state === 'closed') {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.#unsubscribeExitHandlers?.();
|
|
177
|
+
this.#transition('closed');
|
|
178
|
+
}
|
|
179
|
+
/** @returns Current profiler state */
|
|
180
|
+
get state() {
|
|
181
|
+
return this.#state;
|
|
182
|
+
}
|
|
183
|
+
/** @returns Whether profiler is in 'running' state */
|
|
184
|
+
isEnabled() {
|
|
185
|
+
return this.#state === 'running';
|
|
186
|
+
}
|
|
187
|
+
/** Enables profiling (start/stop) */
|
|
188
|
+
setEnabled(enabled) {
|
|
189
|
+
if (enabled) {
|
|
190
|
+
this.#transition('running');
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.#transition('idle');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** @returns Queue statistics and profiling state for monitoring */
|
|
197
|
+
get stats() {
|
|
198
|
+
return {
|
|
199
|
+
...this.#performanceObserverSink.getStats(),
|
|
200
|
+
debug: this.#debug,
|
|
201
|
+
state: this.#state,
|
|
202
|
+
walOpen: !this.#sink.isClosed(),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** Flushes buffered performance data to sink. */
|
|
206
|
+
flush() {
|
|
207
|
+
if (this.#state === 'closed') {
|
|
208
|
+
return; // No-op if closed
|
|
209
|
+
}
|
|
210
|
+
this.#performanceObserverSink.flush();
|
|
211
|
+
}
|
|
212
|
+
/** @returns The file path of the WriteAheadLogFile sink */
|
|
213
|
+
get filePath() {
|
|
214
|
+
return this.#sink.getPath();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=profiler-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiler-node.js","sourceRoot":"","sources":["../../../../src/lib/profiler/profiler-node.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAEL,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAKjF,OAAO,EAEL,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA8B1D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,cAMX,SAAQ,QAAgB;IACxB,KAAK,CAA+B;IACpC,wBAAwB,CAAwC;IAChE,MAAM,GAAkC,MAAM,CAAC;IAC/C,MAAM,CAAU;IAChB,wBAAwB,CAA2B;IAEnD;;;;OAIG;IACH,kDAAkD;IAClD,YAAY,OAAoD;QAC9D,MAAM,EACJ,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,WAAW,GAAG,sBAA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P,OAAO;YACL,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,EAAE;YAC3C,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,iDAAiD;IACjD,KAAK;QACH,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,CAAC,kBAAkB;QAC5B,CAAC;QACD,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;IAED,2DAA2D;IAC3D,IAAI,QAAQ;QACV,OAAQ,IAAI,CAAC,KAAyC,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type PerformanceObserverOptions } from '../performance-observer.js';
|
|
2
1
|
import { type ActionTrackConfigs, type MeasureCtxOptions, type MeasureOptions } from '../user-timing-extensibility-api-utils.js';
|
|
3
2
|
import type { ActionTrackEntryPayload, DevToolsColor, EntryMeta } from '../user-timing-extensibility-api.type.js';
|
|
4
|
-
import type { AppendableSink } from '../wal.js';
|
|
5
3
|
/**
|
|
6
4
|
* Generates a unique profiler ID based on performance time origin, process ID, thread ID, and instance count.
|
|
7
5
|
*/
|
|
@@ -139,84 +137,4 @@ export declare class Profiler<T extends ActionTrackConfigs> {
|
|
|
139
137
|
*/
|
|
140
138
|
measureAsync<R>(event: string, work: () => Promise<R>, options?: MeasureOptions<R>): Promise<R>;
|
|
141
139
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Options for configuring a NodejsProfiler instance.
|
|
144
|
-
*
|
|
145
|
-
* Extends ProfilerOptions with a required sink parameter.
|
|
146
|
-
*
|
|
147
|
-
* @template Tracks - Record type defining available track names and their configurations
|
|
148
|
-
*/
|
|
149
|
-
export type NodejsProfilerOptions<DomainEvents, Tracks extends Record<string, ActionTrackEntryPayload>> = ProfilerOptions<Tracks> & Omit<PerformanceObserverOptions<DomainEvents>, 'sink'> & {
|
|
150
|
-
/**
|
|
151
|
-
* Sink for buffering and flushing performance data
|
|
152
|
-
*/
|
|
153
|
-
sink: AppendableSink<DomainEvents>;
|
|
154
|
-
/**
|
|
155
|
-
* Name of the environment variable to check for debug mode.
|
|
156
|
-
* When the env var is set to 'true', profiler state transitions create performance marks for debugging.
|
|
157
|
-
*
|
|
158
|
-
* @default 'CP_PROFILER_DEBUG'
|
|
159
|
-
*/
|
|
160
|
-
debugEnvVar?: string;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Performance profiler with automatic process exit handling for buffered performance data.
|
|
164
|
-
*
|
|
165
|
-
* This class extends the base {@link Profiler} with automatic flushing of performance data
|
|
166
|
-
* when the process exits. It accepts a {@link PerformanceObserverSink} that buffers performance
|
|
167
|
-
* entries and ensures they are written out during process termination, even for unexpected exits.
|
|
168
|
-
*
|
|
169
|
-
* The sink defines the output format for performance data, enabling flexible serialization
|
|
170
|
-
* to various formats such as DevTools TraceEvent JSON, OpenTelemetry protocol buffers,
|
|
171
|
-
* or custom domain-specific formats.
|
|
172
|
-
*
|
|
173
|
-
* The profiler automatically subscribes to the performance observer when enabled and installs
|
|
174
|
-
* exit handlers that flush buffered data on process termination (signals, fatal errors, or normal exit).
|
|
175
|
-
*
|
|
176
|
-
*/
|
|
177
|
-
export declare class NodejsProfiler<DomainEvents, Tracks extends Record<string, ActionTrackEntryPayload> = Record<string, ActionTrackEntryPayload>> extends Profiler<Tracks> {
|
|
178
|
-
#private;
|
|
179
|
-
/**
|
|
180
|
-
* Creates a NodejsProfiler instance.
|
|
181
|
-
* @param options - Configuration with required sink
|
|
182
|
-
*/
|
|
183
|
-
constructor(options: NodejsProfilerOptions<DomainEvents, Tracks>);
|
|
184
|
-
/**
|
|
185
|
-
* Returns whether debug mode is enabled for profiler state transitions.
|
|
186
|
-
*
|
|
187
|
-
* Debug mode is determined by the environment variable specified by `debugEnvVar`
|
|
188
|
-
* (defaults to 'CP_PROFILER_DEBUG'). When enabled, profiler state transitions create
|
|
189
|
-
* performance marks for debugging.
|
|
190
|
-
*
|
|
191
|
-
* @returns true if debug mode is enabled, false otherwise
|
|
192
|
-
*/
|
|
193
|
-
get debug(): boolean;
|
|
194
|
-
/**
|
|
195
|
-
* Closes profiler and releases resources. Idempotent, safe for exit handlers.
|
|
196
|
-
* **Exit Handler Usage**: Call only this method from process exit handlers.
|
|
197
|
-
*/
|
|
198
|
-
close(): void;
|
|
199
|
-
/** @returns Current profiler state */
|
|
200
|
-
get state(): 'idle' | 'running' | 'closed';
|
|
201
|
-
/** @returns Whether profiler is in 'running' state */
|
|
202
|
-
isEnabled(): boolean;
|
|
203
|
-
/** Enables profiling (start/stop) */
|
|
204
|
-
setEnabled(enabled: boolean): void;
|
|
205
|
-
/** @returns Queue statistics and profiling state for monitoring */
|
|
206
|
-
get stats(): {
|
|
207
|
-
debug: boolean;
|
|
208
|
-
state: "idle" | "running" | "closed";
|
|
209
|
-
walOpen: boolean;
|
|
210
|
-
isSubscribed: boolean;
|
|
211
|
-
queued: number;
|
|
212
|
-
dropped: number;
|
|
213
|
-
written: number;
|
|
214
|
-
maxQueueSize: number;
|
|
215
|
-
flushThreshold: number;
|
|
216
|
-
addedSinceLastFlush: number;
|
|
217
|
-
buffered: boolean;
|
|
218
|
-
};
|
|
219
|
-
/** Flushes buffered performance data to sink. */
|
|
220
|
-
flush(): void;
|
|
221
|
-
}
|
|
222
140
|
export {};
|
|
@@ -2,10 +2,8 @@ import { performance } from 'node:perf_hooks';
|
|
|
2
2
|
import process from 'node:process';
|
|
3
3
|
import { threadId } from 'node:worker_threads';
|
|
4
4
|
import { isEnvVarEnabled } from '../env.js';
|
|
5
|
-
import { PerformanceObserverSink, } from '../performance-observer.js';
|
|
6
|
-
import { objectToEntries } from '../transform.js';
|
|
7
5
|
import { asOptions, markerPayload, measureCtx, setupTracks, } from '../user-timing-extensibility-api-utils.js';
|
|
8
|
-
import {
|
|
6
|
+
import { PROFILER_ENABLED_ENV_VAR } from './constants.js';
|
|
9
7
|
/**
|
|
10
8
|
* Generates a unique profiler ID based on performance time origin, process ID, thread ID, and instance count.
|
|
11
9
|
*/
|
|
@@ -173,143 +171,4 @@ export class Profiler {
|
|
|
173
171
|
}
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Performance profiler with automatic process exit handling for buffered performance data.
|
|
178
|
-
*
|
|
179
|
-
* This class extends the base {@link Profiler} with automatic flushing of performance data
|
|
180
|
-
* when the process exits. It accepts a {@link PerformanceObserverSink} that buffers performance
|
|
181
|
-
* entries and ensures they are written out during process termination, even for unexpected exits.
|
|
182
|
-
*
|
|
183
|
-
* The sink defines the output format for performance data, enabling flexible serialization
|
|
184
|
-
* to various formats such as DevTools TraceEvent JSON, OpenTelemetry protocol buffers,
|
|
185
|
-
* or custom domain-specific formats.
|
|
186
|
-
*
|
|
187
|
-
* The profiler automatically subscribes to the performance observer when enabled and installs
|
|
188
|
-
* exit handlers that flush buffered data on process termination (signals, fatal errors, or normal exit).
|
|
189
|
-
*
|
|
190
|
-
*/
|
|
191
|
-
export class NodejsProfiler extends Profiler {
|
|
192
|
-
#sink;
|
|
193
|
-
#performanceObserverSink;
|
|
194
|
-
#state = 'idle';
|
|
195
|
-
#debug;
|
|
196
|
-
/**
|
|
197
|
-
* Creates a NodejsProfiler instance.
|
|
198
|
-
* @param options - Configuration with required sink
|
|
199
|
-
*/
|
|
200
|
-
constructor(options) {
|
|
201
|
-
const { sink, encodePerfEntry, captureBufferedEntries, flushThreshold, maxQueueSize, enabled, debugEnvVar = PROFILER_DEBUG_ENV_VAR, ...profilerOptions } = options;
|
|
202
|
-
const initialEnabled = enabled ?? isEnvVarEnabled(PROFILER_ENABLED_ENV_VAR);
|
|
203
|
-
super({ ...profilerOptions, enabled: initialEnabled });
|
|
204
|
-
this.#sink = sink;
|
|
205
|
-
this.#debug = isEnvVarEnabled(debugEnvVar);
|
|
206
|
-
this.#performanceObserverSink = new PerformanceObserverSink({
|
|
207
|
-
sink,
|
|
208
|
-
encodePerfEntry,
|
|
209
|
-
captureBufferedEntries,
|
|
210
|
-
flushThreshold,
|
|
211
|
-
maxQueueSize,
|
|
212
|
-
debugEnvVar,
|
|
213
|
-
});
|
|
214
|
-
if (initialEnabled) {
|
|
215
|
-
this.#transition('running');
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Returns whether debug mode is enabled for profiler state transitions.
|
|
220
|
-
*
|
|
221
|
-
* Debug mode is determined by the environment variable specified by `debugEnvVar`
|
|
222
|
-
* (defaults to 'CP_PROFILER_DEBUG'). When enabled, profiler state transitions create
|
|
223
|
-
* performance marks for debugging.
|
|
224
|
-
*
|
|
225
|
-
* @returns true if debug mode is enabled, false otherwise
|
|
226
|
-
*/
|
|
227
|
-
get debug() {
|
|
228
|
-
return this.#debug;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Creates a performance marker for a profiler state transition.
|
|
232
|
-
* @param transition - The state transition that occurred
|
|
233
|
-
*/
|
|
234
|
-
#transitionMarker(transition) {
|
|
235
|
-
const transitionMarkerPayload = {
|
|
236
|
-
dataType: 'marker',
|
|
237
|
-
color: 'primary',
|
|
238
|
-
tooltipText: `Profiler state transition: ${transition}`,
|
|
239
|
-
properties: [['Transition', transition], ...objectToEntries(this.stats)],
|
|
240
|
-
};
|
|
241
|
-
this.marker(transition, transitionMarkerPayload);
|
|
242
|
-
}
|
|
243
|
-
#transition(next) {
|
|
244
|
-
if (this.#state === next) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (this.#state === 'closed') {
|
|
248
|
-
throw new Error('Profiler already closed');
|
|
249
|
-
}
|
|
250
|
-
const transition = `${this.#state}->${next}`;
|
|
251
|
-
switch (transition) {
|
|
252
|
-
case 'idle->running':
|
|
253
|
-
super.setEnabled(true);
|
|
254
|
-
this.#sink.open?.();
|
|
255
|
-
this.#performanceObserverSink.subscribe();
|
|
256
|
-
break;
|
|
257
|
-
case 'running->idle':
|
|
258
|
-
case 'running->closed':
|
|
259
|
-
super.setEnabled(false);
|
|
260
|
-
this.#performanceObserverSink.unsubscribe();
|
|
261
|
-
this.#sink.close?.();
|
|
262
|
-
break;
|
|
263
|
-
case 'idle->closed':
|
|
264
|
-
// No-op, was not open
|
|
265
|
-
break;
|
|
266
|
-
default:
|
|
267
|
-
throw new Error(`Invalid transition: ${this.#state} -> ${next}`);
|
|
268
|
-
}
|
|
269
|
-
this.#state = next;
|
|
270
|
-
if (this.#debug) {
|
|
271
|
-
this.#transitionMarker(transition);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Closes profiler and releases resources. Idempotent, safe for exit handlers.
|
|
276
|
-
* **Exit Handler Usage**: Call only this method from process exit handlers.
|
|
277
|
-
*/
|
|
278
|
-
close() {
|
|
279
|
-
this.#transition('closed');
|
|
280
|
-
}
|
|
281
|
-
/** @returns Current profiler state */
|
|
282
|
-
get state() {
|
|
283
|
-
return this.#state;
|
|
284
|
-
}
|
|
285
|
-
/** @returns Whether profiler is in 'running' state */
|
|
286
|
-
isEnabled() {
|
|
287
|
-
return this.#state === 'running';
|
|
288
|
-
}
|
|
289
|
-
/** Enables profiling (start/stop) */
|
|
290
|
-
setEnabled(enabled) {
|
|
291
|
-
if (enabled) {
|
|
292
|
-
this.#transition('running');
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
this.#transition('idle');
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
/** @returns Queue statistics and profiling state for monitoring */
|
|
299
|
-
get stats() {
|
|
300
|
-
return {
|
|
301
|
-
...this.#performanceObserverSink.getStats(),
|
|
302
|
-
debug: this.#debug,
|
|
303
|
-
state: this.#state,
|
|
304
|
-
walOpen: !this.#sink.isClosed(),
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
/** Flushes buffered performance data to sink. */
|
|
308
|
-
flush() {
|
|
309
|
-
if (this.#state === 'closed') {
|
|
310
|
-
return; // No-op if closed
|
|
311
|
-
}
|
|
312
|
-
this.#performanceObserverSink.flush();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
174
|
//# sourceMappingURL=profiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../../../src/lib/profiler/profiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../../../src/lib/profiler/profiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAIL,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,2CAA2C,CAAC;AAMnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,qDAAqD;IACrD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,aAAa,EAAE,CAAC;AACxG,CAAC;AAqCD;;;;;;GAMG;AACH,MAAM,OAAO,QAAQ;IACnB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC;IAChB,EAAE,GAAG,aAAa,EA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AM,CAAC;QACf,CAAC;IACH,CAAC"}
|
package/src/lib/wal.d.ts
CHANGED
|
@@ -161,13 +161,13 @@ export declare function parseWalFormat<T extends object | string = object>(forma
|
|
|
161
161
|
*
|
|
162
162
|
* @returns true if this is the leader WAL process, false otherwise
|
|
163
163
|
*/
|
|
164
|
-
export declare function
|
|
164
|
+
export declare function isCoordinatorProcess(envVarName: string, profilerID: string): boolean;
|
|
165
165
|
/**
|
|
166
166
|
* Initialize the origin PID environment variable if not already set.
|
|
167
167
|
* This must be done as early as possible before any user code runs.
|
|
168
168
|
* Sets envVarName to the current process ID if not already defined.
|
|
169
169
|
*/
|
|
170
|
-
export declare function
|
|
170
|
+
export declare function setCoordinatorProcess(envVarName: string, profilerID: string): void;
|
|
171
171
|
/**
|
|
172
172
|
* Generates a human-readable shard ID.
|
|
173
173
|
* This ID is unique per process/thread/shard combination and used in the file name.
|
|
@@ -226,15 +226,31 @@ export declare function getShardedFinalPath<T extends object | string = object>(
|
|
|
226
226
|
*/
|
|
227
227
|
export declare class ShardedWal<T extends object | string = object> {
|
|
228
228
|
#private;
|
|
229
|
+
static instanceCount: number;
|
|
229
230
|
readonly groupId: string;
|
|
230
231
|
/**
|
|
231
232
|
* Create a sharded WAL manager.
|
|
233
|
+
*
|
|
234
|
+
* @param opt.dir - Base directory to store shard files (defaults to process.cwd())
|
|
235
|
+
* @param opt.format - WAL format configuration
|
|
236
|
+
* @param opt.groupId - Group ID for sharding (defaults to generated group ID)
|
|
237
|
+
* @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID)
|
|
232
238
|
*/
|
|
233
239
|
constructor(opt: {
|
|
234
240
|
dir?: string;
|
|
235
241
|
format: Partial<WalFormat<T>>;
|
|
236
242
|
groupId?: string;
|
|
243
|
+
coordinatorIdEnvVar: string;
|
|
237
244
|
});
|
|
245
|
+
/**
|
|
246
|
+
* Is this instance the coordinator?
|
|
247
|
+
*
|
|
248
|
+
* Coordinator status is determined from the coordinatorIdEnvVar environment variable.
|
|
249
|
+
* The coordinator handles finalization and cleanup of shard files.
|
|
250
|
+
*
|
|
251
|
+
* @returns true if this instance is the coordinator, false otherwise
|
|
252
|
+
*/
|
|
253
|
+
isCoordinator(): boolean;
|
|
238
254
|
shard(shardId?: string): WriteAheadLogFile<T>;
|
|
239
255
|
/** Get all shard file paths matching this WAL's base name */
|
|
240
256
|
private shardFiles;
|
package/src/lib/wal.js
CHANGED
|
@@ -216,7 +216,7 @@ export function parseWalFormat(format) {
|
|
|
216
216
|
*
|
|
217
217
|
* @returns true if this is the leader WAL process, false otherwise
|
|
218
218
|
*/
|
|
219
|
-
export function
|
|
219
|
+
export function isCoordinatorProcess(envVarName, profilerID) {
|
|
220
220
|
return process.env[envVarName] === profilerID;
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
@@ -224,7 +224,7 @@ export function isLeaderWal(envVarName, profilerID) {
|
|
|
224
224
|
* This must be done as early as possible before any user code runs.
|
|
225
225
|
* Sets envVarName to the current process ID if not already defined.
|
|
226
226
|
*/
|
|
227
|
-
export function
|
|
227
|
+
export function setCoordinatorProcess(envVarName, profilerID) {
|
|
228
228
|
if (!process.env[envVarName]) {
|
|
229
229
|
// eslint-disable-next-line functional/immutable-data
|
|
230
230
|
process.env[envVarName] = profilerID;
|
|
@@ -232,6 +232,13 @@ export function setLeaderWal(envVarName, profilerID) {
|
|
|
232
232
|
}
|
|
233
233
|
// eslint-disable-next-line functional/no-let
|
|
234
234
|
let shardCount = 0;
|
|
235
|
+
/**
|
|
236
|
+
* Generates a unique sharded WAL ID based on performance time origin, process ID, thread ID, and instance count.
|
|
237
|
+
*/
|
|
238
|
+
function getShardedWalId() {
|
|
239
|
+
// eslint-disable-next-line functional/immutable-data
|
|
240
|
+
return `${Math.round(performance.timeOrigin)}.${process.pid}.${threadId}.${++ShardedWal.instanceCount}`;
|
|
241
|
+
}
|
|
235
242
|
/**
|
|
236
243
|
* Generates a human-readable shard ID.
|
|
237
244
|
* This ID is unique per process/thread/shard combination and used in the file name.
|
|
@@ -316,19 +323,39 @@ export function getShardedFinalPath(opt) {
|
|
|
316
323
|
* Handles distributed logging across multiple processes/files with atomic finalization.
|
|
317
324
|
*/
|
|
318
325
|
export class ShardedWal {
|
|
326
|
+
static instanceCount = 0;
|
|
327
|
+
#id = getShardedWalId();
|
|
319
328
|
groupId = getShardedGroupId();
|
|
320
329
|
#format;
|
|
321
330
|
#dir = process.cwd();
|
|
331
|
+
#isCoordinator;
|
|
322
332
|
/**
|
|
323
333
|
* Create a sharded WAL manager.
|
|
334
|
+
*
|
|
335
|
+
* @param opt.dir - Base directory to store shard files (defaults to process.cwd())
|
|
336
|
+
* @param opt.format - WAL format configuration
|
|
337
|
+
* @param opt.groupId - Group ID for sharding (defaults to generated group ID)
|
|
338
|
+
* @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID)
|
|
324
339
|
*/
|
|
325
340
|
constructor(opt) {
|
|
326
|
-
const { dir, format, groupId } = opt;
|
|
341
|
+
const { dir, format, groupId, coordinatorIdEnvVar } = opt;
|
|
327
342
|
this.groupId = groupId ?? getShardedGroupId();
|
|
328
343
|
if (dir) {
|
|
329
344
|
this.#dir = dir;
|
|
330
345
|
}
|
|
331
346
|
this.#format = parseWalFormat(format);
|
|
347
|
+
this.#isCoordinator = isCoordinatorProcess(coordinatorIdEnvVar, this.#id);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Is this instance the coordinator?
|
|
351
|
+
*
|
|
352
|
+
* Coordinator status is determined from the coordinatorIdEnvVar environment variable.
|
|
353
|
+
* The coordinator handles finalization and cleanup of shard files.
|
|
354
|
+
*
|
|
355
|
+
* @returns true if this instance is the coordinator, false otherwise
|
|
356
|
+
*/
|
|
357
|
+
isCoordinator() {
|
|
358
|
+
return this.#isCoordinator;
|
|
332
359
|
}
|
|
333
360
|
shard(shardId = getShardId()) {
|
|
334
361
|
return new Wri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