omegon 0.6.8 → 0.6.10
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/extensions/cleave/dispatcher.ts +32 -6
- package/extensions/cleave/index.ts +21 -3
- package/extensions/cleave/subprocess-tracker.ts +72 -0
- package/extensions/project-memory/extraction-v2.ts +206 -434
- package/extensions/project-memory/index.ts +89 -182
- package/extensions/project-memory/llm-direct.ts +260 -0
- package/extensions/project-memory/types.ts +3 -3
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/README.md +3 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/clipboard.linux-x64-gnu.node +0 -0
- package/node_modules/@mariozechner/{clipboard-darwin-arm64 → clipboard-linux-x64-gnu}/package.json +8 -5
- package/node_modules/@styrene-lab/pi-ai/dist/cli.js +0 -0
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +5 -11
- package/node_modules/@types/node/assert.d.ts +11 -171
- package/node_modules/@types/node/async_hooks.d.ts +8 -8
- package/node_modules/@types/node/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/node/buffer.d.ts +44 -168
- package/node_modules/@types/node/child_process.d.ts +21 -64
- package/node_modules/@types/node/cluster.d.ts +240 -332
- package/node_modules/@types/node/console.d.ts +49 -351
- package/node_modules/@types/node/constants.d.ts +3 -4
- package/node_modules/@types/node/crypto.d.ts +287 -1639
- package/node_modules/@types/node/dgram.d.ts +15 -51
- package/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/node/dns/promises.d.ts +3 -3
- package/node_modules/@types/node/dns.d.ts +131 -132
- package/node_modules/@types/node/domain.d.ts +13 -17
- package/node_modules/@types/node/events.d.ts +866 -795
- package/node_modules/@types/node/fs/promises.d.ts +7 -8
- package/node_modules/@types/node/fs.d.ts +419 -455
- package/node_modules/@types/node/globals.d.ts +6 -26
- package/node_modules/@types/node/globals.typedarray.d.ts +60 -0
- package/node_modules/@types/node/http.d.ts +310 -276
- package/node_modules/@types/node/http2.d.ts +528 -804
- package/node_modules/@types/node/https.d.ts +63 -243
- package/node_modules/@types/node/index.d.ts +15 -1
- package/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/node_modules/@types/node/inspector.d.ts +42 -50
- package/node_modules/@types/node/inspector.generated.d.ts +572 -417
- package/node_modules/@types/node/module.d.ts +47 -195
- package/node_modules/@types/node/net.d.ts +68 -189
- package/node_modules/@types/node/os.d.ts +6 -6
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +120 -133
- package/node_modules/@types/node/perf_hooks.d.ts +244 -643
- package/node_modules/@types/node/process.d.ts +219 -127
- package/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/node/querystring.d.ts +4 -4
- package/node_modules/@types/node/quic.d.ts +910 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -3
- package/node_modules/@types/node/readline.d.ts +68 -120
- package/node_modules/@types/node/repl.d.ts +75 -98
- package/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/node/sqlite.d.ts +137 -30
- package/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +176 -453
- package/node_modules/@types/node/stream.d.ts +565 -478
- package/node_modules/@types/node/string_decoder.d.ts +4 -4
- package/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/node_modules/@types/node/test.d.ts +134 -199
- package/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/timers.d.ts +4 -130
- package/node_modules/@types/node/tls.d.ts +109 -179
- package/node_modules/@types/node/trace_events.d.ts +9 -9
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/node/ts5.6/index.d.ts +15 -1
- package/node_modules/@types/node/ts5.7/index.d.ts +15 -1
- package/node_modules/@types/node/tty.d.ts +58 -16
- package/node_modules/@types/node/url.d.ts +78 -594
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +150 -796
- package/node_modules/@types/node/v8.d.ts +31 -21
- package/node_modules/@types/node/vm.d.ts +43 -30
- package/node_modules/@types/node/wasi.d.ts +4 -4
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +7 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +93 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +186 -363
- package/node_modules/@types/node/zlib.d.ts +8 -71
- package/node_modules/cliui/CHANGELOG.md +121 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/esprima/ChangeLog +235 -0
- package/node_modules/mz/HISTORY.md +66 -0
- package/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/node_modules/source-map/CHANGELOG.md +301 -0
- package/node_modules/thenify/History.md +11 -0
- package/node_modules/thenify-all/History.md +11 -0
- package/node_modules/undici-types/agent.d.ts +1 -1
- package/node_modules/undici-types/api.d.ts +2 -2
- package/node_modules/undici-types/balanced-pool.d.ts +2 -1
- package/node_modules/undici-types/cache-interceptor.d.ts +1 -0
- package/node_modules/undici-types/client.d.ts +1 -1
- package/node_modules/undici-types/connector.d.ts +2 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +2 -2
- package/node_modules/undici-types/dispatcher.d.ts +12 -12
- package/node_modules/undici-types/fetch.d.ts +4 -4
- package/node_modules/undici-types/formdata.d.ts +1 -1
- package/node_modules/undici-types/h2c-client.d.ts +1 -1
- package/node_modules/undici-types/index.d.ts +9 -1
- package/node_modules/undici-types/interceptors.d.ts +36 -2
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +1 -1
- package/node_modules/undici-types/readable.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/websocket.d.ts +9 -9
- package/node_modules/which/CHANGELOG.md +166 -0
- package/node_modules/y18n/CHANGELOG.md +100 -0
- package/node_modules/yargs/CHANGELOG.md +88 -0
- package/node_modules/yargs-parser/CHANGELOG.md +263 -0
- package/package.json +5 -5
- package/extensions/render/composition/package-lock.json +0 -534
- package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +0 -19
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/LICENSE +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/README.md +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/index.d.ts +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/package.json +0 -0
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
* performance.measure('A to B', 'A', 'B');
|
|
28
28
|
* });
|
|
29
29
|
* ```
|
|
30
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
30
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/perf_hooks.js)
|
|
31
31
|
*/
|
|
32
|
-
declare module "perf_hooks" {
|
|
33
|
-
import {
|
|
32
|
+
declare module "node:perf_hooks" {
|
|
33
|
+
import { InternalEventTargetEventProperties } from "node:events";
|
|
34
|
+
// #region web types
|
|
34
35
|
type EntryType =
|
|
35
36
|
| "dns" // Node.js only
|
|
36
37
|
| "function" // Node.js only
|
|
@@ -42,76 +43,212 @@ declare module "perf_hooks" {
|
|
|
42
43
|
| "net" // Node.js only
|
|
43
44
|
| "node" // Node.js only
|
|
44
45
|
| "resource"; // available on the Web
|
|
45
|
-
interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
|
|
54
|
-
* property contains additional information about garbage collection operation.
|
|
55
|
-
* See perf_hooks.constants for valid values.
|
|
56
|
-
*/
|
|
57
|
-
readonly flags: number;
|
|
46
|
+
interface ConnectionTimingInfo {
|
|
47
|
+
domainLookupStartTime: number;
|
|
48
|
+
domainLookupEndTime: number;
|
|
49
|
+
connectionStartTime: number;
|
|
50
|
+
connectionEndTime: number;
|
|
51
|
+
secureConnectionStartTime: number;
|
|
52
|
+
ALPNNegotiatedProtocol: string;
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
interface FetchTimingInfo {
|
|
55
|
+
startTime: number;
|
|
56
|
+
redirectStartTime: number;
|
|
57
|
+
redirectEndTime: number;
|
|
58
|
+
postRedirectStartTime: number;
|
|
59
|
+
finalServiceWorkerStartTime: number;
|
|
60
|
+
finalNetworkRequestStartTime: number;
|
|
61
|
+
finalNetworkResponseStartTime: number;
|
|
62
|
+
endTime: number;
|
|
63
|
+
finalConnectionTimingInfo: ConnectionTimingInfo | null;
|
|
64
|
+
encodedBodySize: number;
|
|
65
|
+
decodedBodySize: number;
|
|
66
|
+
}
|
|
67
|
+
type PerformanceEntryList = PerformanceEntry[];
|
|
68
|
+
interface PerformanceMarkOptions {
|
|
69
|
+
detail?: any;
|
|
70
|
+
startTime?: number;
|
|
71
|
+
}
|
|
72
|
+
interface PerformanceMeasureOptions {
|
|
73
|
+
detail?: any;
|
|
74
|
+
duration?: number;
|
|
75
|
+
end?: string | number;
|
|
76
|
+
start?: string | number;
|
|
77
|
+
}
|
|
78
|
+
interface PerformanceObserverCallback {
|
|
79
|
+
(entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
|
|
80
|
+
}
|
|
81
|
+
interface PerformanceObserverInit {
|
|
82
|
+
buffered?: boolean;
|
|
83
|
+
entryTypes?: EntryType[];
|
|
84
|
+
type?: EntryType;
|
|
85
|
+
}
|
|
86
|
+
// TODO: remove in next major
|
|
87
|
+
/** @deprecated Use `TimerifyOptions` instead. */
|
|
88
|
+
interface PerformanceTimerifyOptions extends TimerifyOptions {}
|
|
89
|
+
interface PerformanceEventMap {
|
|
90
|
+
"resourcetimingbufferfull": Event;
|
|
91
|
+
}
|
|
92
|
+
interface Performance extends EventTarget, InternalEventTargetEventProperties<PerformanceEventMap> {
|
|
93
|
+
readonly nodeTiming: PerformanceNodeTiming;
|
|
94
|
+
readonly timeOrigin: number;
|
|
95
|
+
clearMarks(markName?: string): void;
|
|
96
|
+
clearMeasures(measureName?: string): void;
|
|
97
|
+
clearResourceTimings(resourceTimingName?: string): void;
|
|
98
|
+
getEntries(): PerformanceEntryList;
|
|
99
|
+
getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
|
|
100
|
+
getEntriesByType(type: EntryType): PerformanceEntryList;
|
|
101
|
+
mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
|
|
102
|
+
markResourceTiming(
|
|
103
|
+
timingInfo: FetchTimingInfo,
|
|
104
|
+
requestedUrl: string,
|
|
105
|
+
initiatorType: string,
|
|
106
|
+
global: unknown,
|
|
107
|
+
cacheMode: string,
|
|
108
|
+
bodyInfo: unknown,
|
|
109
|
+
responseStatus: number,
|
|
110
|
+
deliveryType?: string,
|
|
111
|
+
): PerformanceResourceTiming;
|
|
112
|
+
measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure;
|
|
113
|
+
measure(measureName: string, options: PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
|
|
114
|
+
now(): number;
|
|
115
|
+
setResourceTimingBufferSize(maxSize: number): void;
|
|
116
|
+
toJSON(): any;
|
|
117
|
+
addEventListener<K extends keyof PerformanceEventMap>(
|
|
118
|
+
type: K,
|
|
119
|
+
listener: (ev: PerformanceEventMap[K]) => void,
|
|
120
|
+
options?: AddEventListenerOptions | boolean,
|
|
121
|
+
): void;
|
|
122
|
+
addEventListener(
|
|
123
|
+
type: string,
|
|
124
|
+
listener: EventListener | EventListenerObject,
|
|
125
|
+
options?: AddEventListenerOptions | boolean,
|
|
126
|
+
): void;
|
|
127
|
+
removeEventListener<K extends keyof PerformanceEventMap>(
|
|
128
|
+
type: K,
|
|
129
|
+
listener: (ev: PerformanceEventMap[K]) => void,
|
|
130
|
+
options?: EventListenerOptions | boolean,
|
|
131
|
+
): void;
|
|
132
|
+
removeEventListener(
|
|
133
|
+
type: string,
|
|
134
|
+
listener: EventListener | EventListenerObject,
|
|
135
|
+
options?: EventListenerOptions | boolean,
|
|
136
|
+
): void;
|
|
76
137
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
138
|
+
* This is an alias of `perf_hooks.eventLoopUtilization()`.
|
|
139
|
+
*
|
|
140
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
141
|
+
* @since v14.10.0, v12.19.0
|
|
142
|
+
* @param utilization1 The result of a previous call to
|
|
143
|
+
* `eventLoopUtilization()`.
|
|
144
|
+
* @param utilization2 The result of a previous call to
|
|
145
|
+
* `eventLoopUtilization()` prior to `utilization1`.
|
|
80
146
|
*/
|
|
81
|
-
|
|
147
|
+
eventLoopUtilization(
|
|
148
|
+
utilization1?: EventLoopUtilization,
|
|
149
|
+
utilization2?: EventLoopUtilization,
|
|
150
|
+
): EventLoopUtilization;
|
|
82
151
|
/**
|
|
83
|
-
*
|
|
152
|
+
* This is an alias of `perf_hooks.timerify()`.
|
|
84
153
|
*
|
|
85
|
-
*
|
|
86
|
-
* * `'mark'` (available on the Web)
|
|
87
|
-
* * `'measure'` (available on the Web)
|
|
88
|
-
* * `'gc'` (Node.js only)
|
|
89
|
-
* * `'function'` (Node.js only)
|
|
90
|
-
* * `'http2'` (Node.js only)
|
|
91
|
-
* * `'http'` (Node.js only)
|
|
154
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
92
155
|
* @since v8.5.0
|
|
93
156
|
*/
|
|
157
|
+
timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
|
158
|
+
}
|
|
159
|
+
var Performance: {
|
|
160
|
+
prototype: Performance;
|
|
161
|
+
new(): Performance;
|
|
162
|
+
};
|
|
163
|
+
interface PerformanceEntry {
|
|
164
|
+
readonly duration: number;
|
|
94
165
|
readonly entryType: EntryType;
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly startTime: number;
|
|
95
168
|
toJSON(): any;
|
|
96
169
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
170
|
+
var PerformanceEntry: {
|
|
171
|
+
prototype: PerformanceEntry;
|
|
172
|
+
new(): PerformanceEntry;
|
|
173
|
+
};
|
|
174
|
+
interface PerformanceMark extends PerformanceEntry {
|
|
102
175
|
readonly detail: any;
|
|
103
|
-
readonly duration: 0;
|
|
104
176
|
readonly entryType: "mark";
|
|
105
177
|
}
|
|
178
|
+
var PerformanceMark: {
|
|
179
|
+
prototype: PerformanceMark;
|
|
180
|
+
new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
|
|
181
|
+
};
|
|
182
|
+
interface PerformanceMeasure extends PerformanceEntry {
|
|
183
|
+
readonly detail: any;
|
|
184
|
+
readonly entryType: "measure";
|
|
185
|
+
}
|
|
186
|
+
var PerformanceMeasure: {
|
|
187
|
+
prototype: PerformanceMeasure;
|
|
188
|
+
new(): PerformanceMeasure;
|
|
189
|
+
};
|
|
190
|
+
interface PerformanceObserver {
|
|
191
|
+
disconnect(): void;
|
|
192
|
+
observe(options: PerformanceObserverInit): void;
|
|
193
|
+
takeRecords(): PerformanceEntryList;
|
|
194
|
+
}
|
|
195
|
+
var PerformanceObserver: {
|
|
196
|
+
prototype: PerformanceObserver;
|
|
197
|
+
new(callback: PerformanceObserverCallback): PerformanceObserver;
|
|
198
|
+
readonly supportedEntryTypes: readonly EntryType[];
|
|
199
|
+
};
|
|
200
|
+
interface PerformanceObserverEntryList {
|
|
201
|
+
getEntries(): PerformanceEntryList;
|
|
202
|
+
getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
|
|
203
|
+
getEntriesByType(type: EntryType): PerformanceEntryList;
|
|
204
|
+
}
|
|
205
|
+
var PerformanceObserverEntryList: {
|
|
206
|
+
prototype: PerformanceObserverEntryList;
|
|
207
|
+
new(): PerformanceObserverEntryList;
|
|
208
|
+
};
|
|
209
|
+
interface PerformanceResourceTiming extends PerformanceEntry {
|
|
210
|
+
readonly connectEnd: number;
|
|
211
|
+
readonly connectStart: number;
|
|
212
|
+
readonly decodedBodySize: number;
|
|
213
|
+
readonly domainLookupEnd: number;
|
|
214
|
+
readonly domainLookupStart: number;
|
|
215
|
+
readonly encodedBodySize: number;
|
|
216
|
+
readonly entryType: "resource";
|
|
217
|
+
readonly fetchStart: number;
|
|
218
|
+
readonly initiatorType: string;
|
|
219
|
+
readonly nextHopProtocol: string;
|
|
220
|
+
readonly redirectEnd: number;
|
|
221
|
+
readonly redirectStart: number;
|
|
222
|
+
readonly requestStart: number;
|
|
223
|
+
readonly responseEnd: number;
|
|
224
|
+
readonly responseStart: number;
|
|
225
|
+
readonly responseStatus: number;
|
|
226
|
+
readonly secureConnectionStart: number;
|
|
227
|
+
readonly transferSize: number;
|
|
228
|
+
readonly workerStart: number;
|
|
229
|
+
toJSON(): any;
|
|
230
|
+
}
|
|
231
|
+
var PerformanceResourceTiming: {
|
|
232
|
+
prototype: PerformanceResourceTiming;
|
|
233
|
+
new(): PerformanceResourceTiming;
|
|
234
|
+
};
|
|
235
|
+
var performance: Performance;
|
|
236
|
+
// #endregion
|
|
106
237
|
/**
|
|
107
|
-
*
|
|
238
|
+
* _This class is an extension by Node.js. It is not available in Web browsers._
|
|
239
|
+
*
|
|
240
|
+
* Provides detailed Node.js timing data.
|
|
108
241
|
*
|
|
109
242
|
* The constructor of this class is not exposed to users directly.
|
|
110
|
-
* @since
|
|
243
|
+
* @since v19.0.0
|
|
111
244
|
*/
|
|
112
|
-
class
|
|
245
|
+
class PerformanceNodeEntry extends PerformanceEntry {
|
|
246
|
+
/**
|
|
247
|
+
* Additional detail specific to the `entryType`.
|
|
248
|
+
* @since v16.0.0
|
|
249
|
+
*/
|
|
113
250
|
readonly detail: any;
|
|
114
|
-
readonly entryType: "
|
|
251
|
+
readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node";
|
|
115
252
|
}
|
|
116
253
|
interface UVMetrics {
|
|
117
254
|
/**
|
|
@@ -127,7 +264,6 @@ declare module "perf_hooks" {
|
|
|
127
264
|
*/
|
|
128
265
|
readonly eventsWaiting: number;
|
|
129
266
|
}
|
|
130
|
-
// TODO: PerformanceNodeEntry is missing
|
|
131
267
|
/**
|
|
132
268
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
133
269
|
*
|
|
@@ -135,8 +271,7 @@ declare module "perf_hooks" {
|
|
|
135
271
|
* is not exposed to users.
|
|
136
272
|
* @since v8.5.0
|
|
137
273
|
*/
|
|
138
|
-
|
|
139
|
-
readonly entryType: "node";
|
|
274
|
+
interface PerformanceNodeTiming extends PerformanceEntry {
|
|
140
275
|
/**
|
|
141
276
|
* The high resolution millisecond timestamp at which the Node.js process
|
|
142
277
|
* completed bootstrapping. If bootstrapping has not yet finished, the property
|
|
@@ -144,6 +279,7 @@ declare module "perf_hooks" {
|
|
|
144
279
|
* @since v8.5.0
|
|
145
280
|
*/
|
|
146
281
|
readonly bootstrapComplete: number;
|
|
282
|
+
readonly entryType: "node";
|
|
147
283
|
/**
|
|
148
284
|
* The high resolution millisecond timestamp at which the Node.js environment was
|
|
149
285
|
* initialized.
|
|
@@ -195,478 +331,6 @@ declare module "perf_hooks" {
|
|
|
195
331
|
*/
|
|
196
332
|
readonly v8Start: number;
|
|
197
333
|
}
|
|
198
|
-
interface EventLoopUtilization {
|
|
199
|
-
idle: number;
|
|
200
|
-
active: number;
|
|
201
|
-
utilization: number;
|
|
202
|
-
}
|
|
203
|
-
interface MarkOptions {
|
|
204
|
-
/**
|
|
205
|
-
* Additional optional detail to include with the mark.
|
|
206
|
-
*/
|
|
207
|
-
detail?: unknown | undefined;
|
|
208
|
-
/**
|
|
209
|
-
* An optional timestamp to be used as the mark time.
|
|
210
|
-
* @default `performance.now()`
|
|
211
|
-
*/
|
|
212
|
-
startTime?: number | undefined;
|
|
213
|
-
}
|
|
214
|
-
interface MeasureOptions {
|
|
215
|
-
/**
|
|
216
|
-
* Additional optional detail to include with the mark.
|
|
217
|
-
*/
|
|
218
|
-
detail?: unknown;
|
|
219
|
-
/**
|
|
220
|
-
* Duration between start and end times.
|
|
221
|
-
*/
|
|
222
|
-
duration?: number | undefined;
|
|
223
|
-
/**
|
|
224
|
-
* Timestamp to be used as the end time, or a string identifying a previously recorded mark.
|
|
225
|
-
*/
|
|
226
|
-
end?: number | string | undefined;
|
|
227
|
-
/**
|
|
228
|
-
* Timestamp to be used as the start time, or a string identifying a previously recorded mark.
|
|
229
|
-
*/
|
|
230
|
-
start?: number | string | undefined;
|
|
231
|
-
}
|
|
232
|
-
interface TimerifyOptions {
|
|
233
|
-
/**
|
|
234
|
-
* A histogram object created using `perf_hooks.createHistogram()` that will record runtime
|
|
235
|
-
* durations in nanoseconds.
|
|
236
|
-
*/
|
|
237
|
-
histogram?: RecordableHistogram | undefined;
|
|
238
|
-
}
|
|
239
|
-
interface Performance {
|
|
240
|
-
/**
|
|
241
|
-
* If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline.
|
|
242
|
-
* If `name` is provided, removes only the named mark.
|
|
243
|
-
* @since v8.5.0
|
|
244
|
-
*/
|
|
245
|
-
clearMarks(name?: string): void;
|
|
246
|
-
/**
|
|
247
|
-
* If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline.
|
|
248
|
-
* If `name` is provided, removes only the named measure.
|
|
249
|
-
* @since v16.7.0
|
|
250
|
-
*/
|
|
251
|
-
clearMeasures(name?: string): void;
|
|
252
|
-
/**
|
|
253
|
-
* If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline.
|
|
254
|
-
* If `name` is provided, removes only the named resource.
|
|
255
|
-
* @since v18.2.0, v16.17.0
|
|
256
|
-
*/
|
|
257
|
-
clearResourceTimings(name?: string): void;
|
|
258
|
-
/**
|
|
259
|
-
* This is an alias of `perf_hooks.eventLoopUtilization()`.
|
|
260
|
-
*
|
|
261
|
-
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
262
|
-
* @since v14.10.0, v12.19.0
|
|
263
|
-
* @param utilization1 The result of a previous call to
|
|
264
|
-
* `eventLoopUtilization()`.
|
|
265
|
-
* @param utilization2 The result of a previous call to
|
|
266
|
-
* `eventLoopUtilization()` prior to `utilization1`.
|
|
267
|
-
*/
|
|
268
|
-
eventLoopUtilization(
|
|
269
|
-
utilization1?: EventLoopUtilization,
|
|
270
|
-
utilization2?: EventLoopUtilization,
|
|
271
|
-
): EventLoopUtilization;
|
|
272
|
-
/**
|
|
273
|
-
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
|
|
274
|
-
* If you are only interested in performance entries of certain types or that have certain names, see
|
|
275
|
-
* `performance.getEntriesByType()` and `performance.getEntriesByName()`.
|
|
276
|
-
* @since v16.7.0
|
|
277
|
-
*/
|
|
278
|
-
getEntries(): PerformanceEntry[];
|
|
279
|
-
/**
|
|
280
|
-
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
|
|
281
|
-
* whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
|
|
282
|
-
* @param name
|
|
283
|
-
* @param type
|
|
284
|
-
* @since v16.7.0
|
|
285
|
-
*/
|
|
286
|
-
getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
|
|
287
|
-
/**
|
|
288
|
-
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
|
|
289
|
-
* whose `performanceEntry.entryType` is equal to `type`.
|
|
290
|
-
* @param type
|
|
291
|
-
* @since v16.7.0
|
|
292
|
-
*/
|
|
293
|
-
getEntriesByType(type: EntryType): PerformanceEntry[];
|
|
294
|
-
/**
|
|
295
|
-
* Creates a new `PerformanceMark` entry in the Performance Timeline.
|
|
296
|
-
* A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`,
|
|
297
|
-
* and whose `performanceEntry.duration` is always `0`.
|
|
298
|
-
* Performance marks are used to mark specific significant moments in the Performance Timeline.
|
|
299
|
-
*
|
|
300
|
-
* The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with
|
|
301
|
-
* `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is
|
|
302
|
-
* performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`.
|
|
303
|
-
* @param name
|
|
304
|
-
*/
|
|
305
|
-
mark(name: string, options?: MarkOptions): PerformanceMark;
|
|
306
|
-
/**
|
|
307
|
-
* Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
|
|
308
|
-
* A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
|
|
309
|
-
* Performance resources are used to mark moments in the Resource Timeline.
|
|
310
|
-
* @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
|
|
311
|
-
* @param requestedUrl The resource url
|
|
312
|
-
* @param initiatorType The initiator name, e.g: 'fetch'
|
|
313
|
-
* @param global
|
|
314
|
-
* @param cacheMode The cache mode must be an empty string ('') or 'local'
|
|
315
|
-
* @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
|
|
316
|
-
* @param responseStatus The response's status code
|
|
317
|
-
* @param deliveryType The delivery type. Default: ''.
|
|
318
|
-
* @since v18.2.0, v16.17.0
|
|
319
|
-
*/
|
|
320
|
-
markResourceTiming(
|
|
321
|
-
timingInfo: object,
|
|
322
|
-
requestedUrl: string,
|
|
323
|
-
initiatorType: string,
|
|
324
|
-
global: object,
|
|
325
|
-
cacheMode: "" | "local",
|
|
326
|
-
bodyInfo: object,
|
|
327
|
-
responseStatus: number,
|
|
328
|
-
deliveryType?: string,
|
|
329
|
-
): PerformanceResourceTiming;
|
|
330
|
-
/**
|
|
331
|
-
* Creates a new PerformanceMeasure entry in the Performance Timeline.
|
|
332
|
-
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
|
|
333
|
-
* and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
|
|
334
|
-
*
|
|
335
|
-
* The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
|
|
336
|
-
* any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
|
|
337
|
-
* then startMark is set to timeOrigin by default.
|
|
338
|
-
*
|
|
339
|
-
* The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
|
|
340
|
-
* properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
|
|
341
|
-
* @param name
|
|
342
|
-
* @param startMark
|
|
343
|
-
* @param endMark
|
|
344
|
-
* @return The PerformanceMeasure entry that was created
|
|
345
|
-
*/
|
|
346
|
-
measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
|
|
347
|
-
measure(name: string, options: MeasureOptions): PerformanceMeasure;
|
|
348
|
-
/**
|
|
349
|
-
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
350
|
-
*
|
|
351
|
-
* An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones.
|
|
352
|
-
* @since v8.5.0
|
|
353
|
-
*/
|
|
354
|
-
readonly nodeTiming: PerformanceNodeTiming;
|
|
355
|
-
/**
|
|
356
|
-
* Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process.
|
|
357
|
-
* @since v8.5.0
|
|
358
|
-
*/
|
|
359
|
-
now(): number;
|
|
360
|
-
/**
|
|
361
|
-
* Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
|
|
362
|
-
*
|
|
363
|
-
* By default the max buffer size is set to 250.
|
|
364
|
-
* @since v18.8.0
|
|
365
|
-
*/
|
|
366
|
-
setResourceTimingBufferSize(maxSize: number): void;
|
|
367
|
-
/**
|
|
368
|
-
* The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp
|
|
369
|
-
* at which the current `node` process began, measured in Unix time.
|
|
370
|
-
* @since v8.5.0
|
|
371
|
-
*/
|
|
372
|
-
readonly timeOrigin: number;
|
|
373
|
-
/**
|
|
374
|
-
* This is an alias of `perf_hooks.timerify()`.
|
|
375
|
-
*
|
|
376
|
-
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
377
|
-
* @since v8.5.0
|
|
378
|
-
*/
|
|
379
|
-
timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
|
380
|
-
/**
|
|
381
|
-
* An object which is JSON representation of the performance object. It is similar to
|
|
382
|
-
* [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
|
|
383
|
-
* @since v16.1.0
|
|
384
|
-
*/
|
|
385
|
-
toJSON(): any;
|
|
386
|
-
}
|
|
387
|
-
class PerformanceObserverEntryList {
|
|
388
|
-
/**
|
|
389
|
-
* Returns a list of `PerformanceEntry` objects in chronological order
|
|
390
|
-
* with respect to `performanceEntry.startTime`.
|
|
391
|
-
*
|
|
392
|
-
* ```js
|
|
393
|
-
* import {
|
|
394
|
-
* performance,
|
|
395
|
-
* PerformanceObserver,
|
|
396
|
-
* } from 'node:perf_hooks';
|
|
397
|
-
*
|
|
398
|
-
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
399
|
-
* console.log(perfObserverList.getEntries());
|
|
400
|
-
*
|
|
401
|
-
* * [
|
|
402
|
-
* * PerformanceEntry {
|
|
403
|
-
* * name: 'test',
|
|
404
|
-
* * entryType: 'mark',
|
|
405
|
-
* * startTime: 81.465639,
|
|
406
|
-
* * duration: 0,
|
|
407
|
-
* * detail: null
|
|
408
|
-
* * },
|
|
409
|
-
* * PerformanceEntry {
|
|
410
|
-
* * name: 'meow',
|
|
411
|
-
* * entryType: 'mark',
|
|
412
|
-
* * startTime: 81.860064,
|
|
413
|
-
* * duration: 0,
|
|
414
|
-
* * detail: null
|
|
415
|
-
* * }
|
|
416
|
-
* * ]
|
|
417
|
-
*
|
|
418
|
-
* performance.clearMarks();
|
|
419
|
-
* performance.clearMeasures();
|
|
420
|
-
* observer.disconnect();
|
|
421
|
-
* });
|
|
422
|
-
* obs.observe({ type: 'mark' });
|
|
423
|
-
*
|
|
424
|
-
* performance.mark('test');
|
|
425
|
-
* performance.mark('meow');
|
|
426
|
-
* ```
|
|
427
|
-
* @since v8.5.0
|
|
428
|
-
*/
|
|
429
|
-
getEntries(): PerformanceEntry[];
|
|
430
|
-
/**
|
|
431
|
-
* Returns a list of `PerformanceEntry` objects in chronological order
|
|
432
|
-
* with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
|
|
433
|
-
* equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
|
|
434
|
-
*
|
|
435
|
-
* ```js
|
|
436
|
-
* import {
|
|
437
|
-
* performance,
|
|
438
|
-
* PerformanceObserver,
|
|
439
|
-
* } from 'node:perf_hooks';
|
|
440
|
-
*
|
|
441
|
-
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
442
|
-
* console.log(perfObserverList.getEntriesByName('meow'));
|
|
443
|
-
*
|
|
444
|
-
* * [
|
|
445
|
-
* * PerformanceEntry {
|
|
446
|
-
* * name: 'meow',
|
|
447
|
-
* * entryType: 'mark',
|
|
448
|
-
* * startTime: 98.545991,
|
|
449
|
-
* * duration: 0,
|
|
450
|
-
* * detail: null
|
|
451
|
-
* * }
|
|
452
|
-
* * ]
|
|
453
|
-
*
|
|
454
|
-
* console.log(perfObserverList.getEntriesByName('nope')); // []
|
|
455
|
-
*
|
|
456
|
-
* console.log(perfObserverList.getEntriesByName('test', 'mark'));
|
|
457
|
-
*
|
|
458
|
-
* * [
|
|
459
|
-
* * PerformanceEntry {
|
|
460
|
-
* * name: 'test',
|
|
461
|
-
* * entryType: 'mark',
|
|
462
|
-
* * startTime: 63.518931,
|
|
463
|
-
* * duration: 0,
|
|
464
|
-
* * detail: null
|
|
465
|
-
* * }
|
|
466
|
-
* * ]
|
|
467
|
-
*
|
|
468
|
-
* console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
|
|
469
|
-
*
|
|
470
|
-
* performance.clearMarks();
|
|
471
|
-
* performance.clearMeasures();
|
|
472
|
-
* observer.disconnect();
|
|
473
|
-
* });
|
|
474
|
-
* obs.observe({ entryTypes: ['mark', 'measure'] });
|
|
475
|
-
*
|
|
476
|
-
* performance.mark('test');
|
|
477
|
-
* performance.mark('meow');
|
|
478
|
-
* ```
|
|
479
|
-
* @since v8.5.0
|
|
480
|
-
*/
|
|
481
|
-
getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
|
|
482
|
-
/**
|
|
483
|
-
* Returns a list of `PerformanceEntry` objects in chronological order
|
|
484
|
-
* with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
|
|
485
|
-
*
|
|
486
|
-
* ```js
|
|
487
|
-
* import {
|
|
488
|
-
* performance,
|
|
489
|
-
* PerformanceObserver,
|
|
490
|
-
* } from 'node:perf_hooks';
|
|
491
|
-
*
|
|
492
|
-
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
493
|
-
* console.log(perfObserverList.getEntriesByType('mark'));
|
|
494
|
-
*
|
|
495
|
-
* * [
|
|
496
|
-
* * PerformanceEntry {
|
|
497
|
-
* * name: 'test',
|
|
498
|
-
* * entryType: 'mark',
|
|
499
|
-
* * startTime: 55.897834,
|
|
500
|
-
* * duration: 0,
|
|
501
|
-
* * detail: null
|
|
502
|
-
* * },
|
|
503
|
-
* * PerformanceEntry {
|
|
504
|
-
* * name: 'meow',
|
|
505
|
-
* * entryType: 'mark',
|
|
506
|
-
* * startTime: 56.350146,
|
|
507
|
-
* * duration: 0,
|
|
508
|
-
* * detail: null
|
|
509
|
-
* * }
|
|
510
|
-
* * ]
|
|
511
|
-
*
|
|
512
|
-
* performance.clearMarks();
|
|
513
|
-
* performance.clearMeasures();
|
|
514
|
-
* observer.disconnect();
|
|
515
|
-
* });
|
|
516
|
-
* obs.observe({ type: 'mark' });
|
|
517
|
-
*
|
|
518
|
-
* performance.mark('test');
|
|
519
|
-
* performance.mark('meow');
|
|
520
|
-
* ```
|
|
521
|
-
* @since v8.5.0
|
|
522
|
-
*/
|
|
523
|
-
getEntriesByType(type: EntryType): PerformanceEntry[];
|
|
524
|
-
}
|
|
525
|
-
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
|
526
|
-
/**
|
|
527
|
-
* @since v8.5.0
|
|
528
|
-
*/
|
|
529
|
-
class PerformanceObserver extends AsyncResource {
|
|
530
|
-
constructor(callback: PerformanceObserverCallback);
|
|
531
|
-
/**
|
|
532
|
-
* Disconnects the `PerformanceObserver` instance from all notifications.
|
|
533
|
-
* @since v8.5.0
|
|
534
|
-
*/
|
|
535
|
-
disconnect(): void;
|
|
536
|
-
/**
|
|
537
|
-
* Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
|
|
538
|
-
*
|
|
539
|
-
* ```js
|
|
540
|
-
* import {
|
|
541
|
-
* performance,
|
|
542
|
-
* PerformanceObserver,
|
|
543
|
-
* } from 'node:perf_hooks';
|
|
544
|
-
*
|
|
545
|
-
* const obs = new PerformanceObserver((list, observer) => {
|
|
546
|
-
* // Called once asynchronously. `list` contains three items.
|
|
547
|
-
* });
|
|
548
|
-
* obs.observe({ type: 'mark' });
|
|
549
|
-
*
|
|
550
|
-
* for (let n = 0; n < 3; n++)
|
|
551
|
-
* performance.mark(`test${n}`);
|
|
552
|
-
* ```
|
|
553
|
-
* @since v8.5.0
|
|
554
|
-
*/
|
|
555
|
-
observe(
|
|
556
|
-
options:
|
|
557
|
-
| {
|
|
558
|
-
entryTypes: readonly EntryType[];
|
|
559
|
-
buffered?: boolean | undefined;
|
|
560
|
-
}
|
|
561
|
-
| {
|
|
562
|
-
type: EntryType;
|
|
563
|
-
buffered?: boolean | undefined;
|
|
564
|
-
},
|
|
565
|
-
): void;
|
|
566
|
-
/**
|
|
567
|
-
* @since v16.0.0
|
|
568
|
-
* @returns Current list of entries stored in the performance observer, emptying it out.
|
|
569
|
-
*/
|
|
570
|
-
takeRecords(): PerformanceEntry[];
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Provides detailed network timing data regarding the loading of an application's resources.
|
|
574
|
-
*
|
|
575
|
-
* The constructor of this class is not exposed to users directly.
|
|
576
|
-
* @since v18.2.0, v16.17.0
|
|
577
|
-
*/
|
|
578
|
-
class PerformanceResourceTiming extends PerformanceEntry {
|
|
579
|
-
readonly entryType: "resource";
|
|
580
|
-
protected constructor();
|
|
581
|
-
/**
|
|
582
|
-
* The high resolution millisecond timestamp at immediately before dispatching the `fetch`
|
|
583
|
-
* request. If the resource is not intercepted by a worker the property will always return 0.
|
|
584
|
-
* @since v18.2.0, v16.17.0
|
|
585
|
-
*/
|
|
586
|
-
readonly workerStart: number;
|
|
587
|
-
/**
|
|
588
|
-
* The high resolution millisecond timestamp that represents the start time of the fetch which
|
|
589
|
-
* initiates the redirect.
|
|
590
|
-
* @since v18.2.0, v16.17.0
|
|
591
|
-
*/
|
|
592
|
-
readonly redirectStart: number;
|
|
593
|
-
/**
|
|
594
|
-
* The high resolution millisecond timestamp that will be created immediately after receiving
|
|
595
|
-
* the last byte of the response of the last redirect.
|
|
596
|
-
* @since v18.2.0, v16.17.0
|
|
597
|
-
*/
|
|
598
|
-
readonly redirectEnd: number;
|
|
599
|
-
/**
|
|
600
|
-
* The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
|
|
601
|
-
* @since v18.2.0, v16.17.0
|
|
602
|
-
*/
|
|
603
|
-
readonly fetchStart: number;
|
|
604
|
-
/**
|
|
605
|
-
* The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
|
|
606
|
-
* for the resource.
|
|
607
|
-
* @since v18.2.0, v16.17.0
|
|
608
|
-
*/
|
|
609
|
-
readonly domainLookupStart: number;
|
|
610
|
-
/**
|
|
611
|
-
* The high resolution millisecond timestamp representing the time immediately after the Node.js finished
|
|
612
|
-
* the domain name lookup for the resource.
|
|
613
|
-
* @since v18.2.0, v16.17.0
|
|
614
|
-
*/
|
|
615
|
-
readonly domainLookupEnd: number;
|
|
616
|
-
/**
|
|
617
|
-
* The high resolution millisecond timestamp representing the time immediately before Node.js starts to
|
|
618
|
-
* establish the connection to the server to retrieve the resource.
|
|
619
|
-
* @since v18.2.0, v16.17.0
|
|
620
|
-
*/
|
|
621
|
-
readonly connectStart: number;
|
|
622
|
-
/**
|
|
623
|
-
* The high resolution millisecond timestamp representing the time immediately after Node.js finishes
|
|
624
|
-
* establishing the connection to the server to retrieve the resource.
|
|
625
|
-
* @since v18.2.0, v16.17.0
|
|
626
|
-
*/
|
|
627
|
-
readonly connectEnd: number;
|
|
628
|
-
/**
|
|
629
|
-
* The high resolution millisecond timestamp representing the time immediately before Node.js starts the
|
|
630
|
-
* handshake process to secure the current connection.
|
|
631
|
-
* @since v18.2.0, v16.17.0
|
|
632
|
-
*/
|
|
633
|
-
readonly secureConnectionStart: number;
|
|
634
|
-
/**
|
|
635
|
-
* The high resolution millisecond timestamp representing the time immediately before Node.js receives the
|
|
636
|
-
* first byte of the response from the server.
|
|
637
|
-
* @since v18.2.0, v16.17.0
|
|
638
|
-
*/
|
|
639
|
-
readonly requestStart: number;
|
|
640
|
-
/**
|
|
641
|
-
* The high resolution millisecond timestamp representing the time immediately after Node.js receives the
|
|
642
|
-
* last byte of the resource or immediately before the transport connection is closed, whichever comes first.
|
|
643
|
-
* @since v18.2.0, v16.17.0
|
|
644
|
-
*/
|
|
645
|
-
readonly responseEnd: number;
|
|
646
|
-
/**
|
|
647
|
-
* A number representing the size (in octets) of the fetched resource. The size includes the response header
|
|
648
|
-
* fields plus the response payload body.
|
|
649
|
-
* @since v18.2.0, v16.17.0
|
|
650
|
-
*/
|
|
651
|
-
readonly transferSize: number;
|
|
652
|
-
/**
|
|
653
|
-
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
|
|
654
|
-
* removing any applied content-codings.
|
|
655
|
-
* @since v18.2.0, v16.17.0
|
|
656
|
-
*/
|
|
657
|
-
readonly encodedBodySize: number;
|
|
658
|
-
/**
|
|
659
|
-
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
|
|
660
|
-
* removing any applied content-codings.
|
|
661
|
-
* @since v18.2.0, v16.17.0
|
|
662
|
-
*/
|
|
663
|
-
readonly decodedBodySize: number;
|
|
664
|
-
/**
|
|
665
|
-
* Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
|
|
666
|
-
* @since v18.2.0, v16.17.0
|
|
667
|
-
*/
|
|
668
|
-
toJSON(): any;
|
|
669
|
-
}
|
|
670
334
|
namespace constants {
|
|
671
335
|
const NODE_PERFORMANCE_GC_MAJOR: number;
|
|
672
336
|
const NODE_PERFORMANCE_GC_MINOR: number;
|
|
@@ -680,7 +344,6 @@ declare module "perf_hooks" {
|
|
|
680
344
|
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
|
|
681
345
|
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
|
|
682
346
|
}
|
|
683
|
-
const performance: Performance;
|
|
684
347
|
interface EventLoopMonitorOptions {
|
|
685
348
|
/**
|
|
686
349
|
* The sampling rate in milliseconds.
|
|
@@ -815,29 +478,11 @@ declare module "perf_hooks" {
|
|
|
815
478
|
*/
|
|
816
479
|
add(other: RecordableHistogram): void;
|
|
817
480
|
}
|
|
818
|
-
interface
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
*/
|
|
823
|
-
lowest?: number | bigint | undefined;
|
|
824
|
-
/**
|
|
825
|
-
* The highest recordable value. Must be an integer value that is equal to
|
|
826
|
-
* or greater than two times `lowest`.
|
|
827
|
-
* @default Number.MAX_SAFE_INTEGER
|
|
828
|
-
*/
|
|
829
|
-
highest?: number | bigint | undefined;
|
|
830
|
-
/**
|
|
831
|
-
* The number of accuracy digits. Must be a number between `1` and `5`.
|
|
832
|
-
* @default 3
|
|
833
|
-
*/
|
|
834
|
-
figures?: number | undefined;
|
|
481
|
+
interface EventLoopUtilization {
|
|
482
|
+
idle: number;
|
|
483
|
+
active: number;
|
|
484
|
+
utilization: number;
|
|
835
485
|
}
|
|
836
|
-
/**
|
|
837
|
-
* Returns a {@link RecordableHistogram `RecordableHistogram`}.
|
|
838
|
-
* @since v15.9.0, v14.18.0
|
|
839
|
-
*/
|
|
840
|
-
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
841
486
|
/**
|
|
842
487
|
* The `eventLoopUtilization()` function returns an object that contains the
|
|
843
488
|
* cumulative duration of time the event loop has been both idle and active as a
|
|
@@ -845,9 +490,8 @@ declare module "perf_hooks" {
|
|
|
845
490
|
* Event Loop Utilization (ELU).
|
|
846
491
|
*
|
|
847
492
|
* If bootstrapping has not yet finished on the main thread the properties have
|
|
848
|
-
* the value of `0`. The ELU is immediately available on
|
|
849
|
-
*
|
|
850
|
-
* since bootstrap happens within the event loop.
|
|
493
|
+
* the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since
|
|
494
|
+
* bootstrap happens within the event loop.
|
|
851
495
|
*
|
|
852
496
|
* Both `utilization1` and `utilization2` are optional parameters.
|
|
853
497
|
*
|
|
@@ -877,16 +521,18 @@ declare module "perf_hooks" {
|
|
|
877
521
|
* });
|
|
878
522
|
* ```
|
|
879
523
|
*
|
|
880
|
-
* Although the CPU is mostly idle while running this script, the value of
|
|
881
|
-
* is `1`. This is because the call to
|
|
882
|
-
* from proceeding.
|
|
524
|
+
* Although the CPU is mostly idle while running this script, the value of
|
|
525
|
+
* `utilization` is `1`. This is because the call to
|
|
526
|
+
* `child_process.spawnSync()` blocks the event loop from proceeding.
|
|
883
527
|
*
|
|
884
528
|
* Passing in a user-defined object instead of the result of a previous call to
|
|
885
|
-
* `eventLoopUtilization()` will lead to undefined behavior. The return values
|
|
886
|
-
* guaranteed to reflect any correct state of the event loop.
|
|
887
|
-
* @since
|
|
888
|
-
* @param utilization1 The result of a previous call to
|
|
889
|
-
*
|
|
529
|
+
* `eventLoopUtilization()` will lead to undefined behavior. The return values
|
|
530
|
+
* are not guaranteed to reflect any correct state of the event loop.
|
|
531
|
+
* @since v25.2.0
|
|
532
|
+
* @param utilization1 The result of a previous call to
|
|
533
|
+
* `eventLoopUtilization()`.
|
|
534
|
+
* @param utilization2 The result of a previous call to
|
|
535
|
+
* `eventLoopUtilization()` prior to `utilization1`.
|
|
890
536
|
*/
|
|
891
537
|
function eventLoopUtilization(
|
|
892
538
|
utilization1?: EventLoopUtilization,
|
|
@@ -921,6 +567,14 @@ declare module "perf_hooks" {
|
|
|
921
567
|
* @since v11.10.0
|
|
922
568
|
*/
|
|
923
569
|
function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
|
|
570
|
+
interface TimerifyOptions {
|
|
571
|
+
/**
|
|
572
|
+
* A histogram object created using
|
|
573
|
+
* `perf_hooks.createHistogram()` that will record runtime durations in
|
|
574
|
+
* nanoseconds.
|
|
575
|
+
*/
|
|
576
|
+
histogram?: RecordableHistogram | undefined;
|
|
577
|
+
}
|
|
924
578
|
/**
|
|
925
579
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
926
580
|
*
|
|
@@ -951,92 +605,39 @@ declare module "perf_hooks" {
|
|
|
951
605
|
* ```
|
|
952
606
|
*
|
|
953
607
|
* If the wrapped function returns a promise, a finally handler will be attached
|
|
954
|
-
* to the promise and the duration will be reported once the finally handler is
|
|
955
|
-
*
|
|
608
|
+
* to the promise and the duration will be reported once the finally handler is
|
|
609
|
+
* invoked.
|
|
610
|
+
* @since v25.2.0
|
|
956
611
|
*/
|
|
957
|
-
function timerify<T extends (...
|
|
958
|
-
|
|
959
|
-
performance as _performance,
|
|
960
|
-
PerformanceEntry as _PerformanceEntry,
|
|
961
|
-
PerformanceMark as _PerformanceMark,
|
|
962
|
-
PerformanceMeasure as _PerformanceMeasure,
|
|
963
|
-
PerformanceObserver as _PerformanceObserver,
|
|
964
|
-
PerformanceObserverEntryList as _PerformanceObserverEntryList,
|
|
965
|
-
PerformanceResourceTiming as _PerformanceResourceTiming,
|
|
966
|
-
} from "perf_hooks";
|
|
967
|
-
global {
|
|
968
|
-
/**
|
|
969
|
-
* `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
|
|
970
|
-
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceentry
|
|
971
|
-
* @since v19.0.0
|
|
972
|
-
*/
|
|
973
|
-
var PerformanceEntry: typeof globalThis extends {
|
|
974
|
-
onmessage: any;
|
|
975
|
-
PerformanceEntry: infer T;
|
|
976
|
-
} ? T
|
|
977
|
-
: typeof _PerformanceEntry;
|
|
978
|
-
/**
|
|
979
|
-
* `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
|
|
980
|
-
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemark
|
|
981
|
-
* @since v19.0.0
|
|
982
|
-
*/
|
|
983
|
-
var PerformanceMark: typeof globalThis extends {
|
|
984
|
-
onmessage: any;
|
|
985
|
-
PerformanceMark: infer T;
|
|
986
|
-
} ? T
|
|
987
|
-
: typeof _PerformanceMark;
|
|
988
|
-
/**
|
|
989
|
-
* `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
|
|
990
|
-
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemeasure
|
|
991
|
-
* @since v19.0.0
|
|
992
|
-
*/
|
|
993
|
-
var PerformanceMeasure: typeof globalThis extends {
|
|
994
|
-
onmessage: any;
|
|
995
|
-
PerformanceMeasure: infer T;
|
|
996
|
-
} ? T
|
|
997
|
-
: typeof _PerformanceMeasure;
|
|
998
|
-
/**
|
|
999
|
-
* `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
|
|
1000
|
-
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserver
|
|
1001
|
-
* @since v19.0.0
|
|
1002
|
-
*/
|
|
1003
|
-
var PerformanceObserver: typeof globalThis extends {
|
|
1004
|
-
onmessage: any;
|
|
1005
|
-
PerformanceObserver: infer T;
|
|
1006
|
-
} ? T
|
|
1007
|
-
: typeof _PerformanceObserver;
|
|
612
|
+
function timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
|
613
|
+
interface CreateHistogramOptions {
|
|
1008
614
|
/**
|
|
1009
|
-
*
|
|
1010
|
-
* @
|
|
1011
|
-
* @since v19.0.0
|
|
615
|
+
* The minimum recordable value. Must be an integer value greater than 0.
|
|
616
|
+
* @default 1
|
|
1012
617
|
*/
|
|
1013
|
-
|
|
1014
|
-
onmessage: any;
|
|
1015
|
-
PerformanceObserverEntryList: infer T;
|
|
1016
|
-
} ? T
|
|
1017
|
-
: typeof _PerformanceObserverEntryList;
|
|
618
|
+
lowest?: number | bigint | undefined;
|
|
1018
619
|
/**
|
|
1019
|
-
*
|
|
1020
|
-
* @
|
|
1021
|
-
* @since v19.0.0
|
|
620
|
+
* The maximum recordable value. Must be an integer value greater than min.
|
|
621
|
+
* @default Number.MAX_SAFE_INTEGER
|
|
1022
622
|
*/
|
|
1023
|
-
|
|
1024
|
-
onmessage: any;
|
|
1025
|
-
PerformanceResourceTiming: infer T;
|
|
1026
|
-
} ? T
|
|
1027
|
-
: typeof _PerformanceResourceTiming;
|
|
623
|
+
highest?: number | bigint | undefined;
|
|
1028
624
|
/**
|
|
1029
|
-
*
|
|
1030
|
-
* @
|
|
1031
|
-
* @since v16.0.0
|
|
625
|
+
* The number of accuracy digits. Must be a number between 1 and 5.
|
|
626
|
+
* @default 3
|
|
1032
627
|
*/
|
|
1033
|
-
|
|
1034
|
-
onmessage: any;
|
|
1035
|
-
performance: infer T;
|
|
1036
|
-
} ? T
|
|
1037
|
-
: typeof _performance;
|
|
628
|
+
figures?: number | undefined;
|
|
1038
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* Returns a `RecordableHistogram`.
|
|
632
|
+
* @since v15.9.0, v14.18.0
|
|
633
|
+
*/
|
|
634
|
+
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
635
|
+
// TODO: remove these in a future major
|
|
636
|
+
/** @deprecated Use the canonical `PerformanceMarkOptions` instead. */
|
|
637
|
+
interface MarkOptions extends PerformanceMarkOptions {}
|
|
638
|
+
/** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */
|
|
639
|
+
interface MeasureOptions extends PerformanceMeasureOptions {}
|
|
1039
640
|
}
|
|
1040
|
-
declare module "
|
|
1041
|
-
export * from "perf_hooks";
|
|
641
|
+
declare module "perf_hooks" {
|
|
642
|
+
export * from "node:perf_hooks";
|
|
1042
643
|
}
|