cloudstructs 0.6.11 → 0.6.13

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.
Files changed (158) hide show
  1. package/.jsii +3 -3
  2. package/assets/slack-app/provider.lambda/index.js +4 -5
  3. package/assets/slack-textract/detect.lambda/index.js +4 -5
  4. package/assets/ssl-server-test/analyze.lambda/index.js +4 -5
  5. package/lib/codecommit-mirror/index.js +2 -2
  6. package/lib/ecs-service-roller/index.js +2 -2
  7. package/lib/email-receiver/receiver.js +1 -1
  8. package/lib/saml-identity-provider/index.js +2 -2
  9. package/lib/slack-app/manifest.js +1 -1
  10. package/lib/slack-app/slack-app.js +2 -2
  11. package/lib/slack-events/index.js +1 -1
  12. package/lib/slack-textract/index.js +1 -1
  13. package/lib/ssl-server-test/index.js +1 -1
  14. package/lib/state-machine-cr-provider/index.js +1 -1
  15. package/lib/static-website/index.js +1 -1
  16. package/lib/toolkit-cleaner/index.js +1 -1
  17. package/lib/url-shortener/index.js +1 -1
  18. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  19. package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -2
  20. package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +62 -2
  21. package/node_modules/@slack/logger/node_modules/@types/node/ts4.8/test.d.ts +62 -2
  22. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  23. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  24. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +62 -2
  25. package/node_modules/@slack/web-api/node_modules/@types/node/ts4.8/test.d.ts +62 -2
  26. package/node_modules/@types/cacheable-request/README.md +2 -2
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +62 -2
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/test.d.ts +62 -2
  31. package/node_modules/@types/cacheable-request/package.json +5 -5
  32. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +1 -1
  33. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +2 -2
  34. package/node_modules/@types/is-stream/node_modules/@types/node/test.d.ts +62 -2
  35. package/node_modules/@types/is-stream/node_modules/@types/node/ts4.8/test.d.ts +62 -2
  36. package/node_modules/@types/keyv/README.md +16 -3
  37. package/node_modules/@types/keyv/index.d.ts +90 -0
  38. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
  39. package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
  40. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
  41. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +961 -0
  42. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +501 -0
  43. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2258 -0
  44. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1369 -0
  45. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +410 -0
  46. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
  47. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
  48. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3964 -0
  49. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
  50. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +153 -0
  51. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +370 -0
  52. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +659 -0
  53. package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +126 -0
  54. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +170 -0
  55. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +678 -0
  56. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1138 -0
  57. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3872 -0
  58. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +300 -0
  59. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
  60. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1614 -0
  61. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2134 -0
  62. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +541 -0
  63. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +133 -0
  64. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2741 -0
  65. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
  66. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +869 -0
  67. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +466 -0
  68. package/node_modules/@types/keyv/node_modules/@types/node/package.json +232 -0
  69. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +191 -0
  70. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +625 -0
  71. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1482 -0
  72. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
  73. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
  74. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +143 -0
  75. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +653 -0
  76. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
  77. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +12 -0
  78. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
  79. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +330 -0
  80. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1340 -0
  81. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
  82. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +374 -0
  83. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
  84. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
  85. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1028 -0
  86. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +171 -0
  87. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  88. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert.d.ts +961 -0
  89. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/async_hooks.d.ts +501 -0
  90. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/buffer.d.ts +2259 -0
  91. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/child_process.d.ts +1369 -0
  92. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
  93. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  94. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  95. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/crypto.d.ts +3964 -0
  96. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  97. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +153 -0
  98. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns/promises.d.ts +370 -0
  99. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns.d.ts +659 -0
  100. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  101. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  102. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/events.d.ts +678 -0
  103. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs/promises.d.ts +1138 -0
  104. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs.d.ts +3872 -0
  105. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.d.ts +294 -0
  106. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  107. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http.d.ts +1614 -0
  108. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http2.d.ts +2134 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/https.d.ts +541 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/inspector.d.ts +2741 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/module.d.ts +114 -0
  113. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/net.d.ts +869 -0
  114. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/os.d.ts +466 -0
  115. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  116. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/perf_hooks.d.ts +625 -0
  117. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/process.d.ts +1482 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  119. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
  121. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline.d.ts +653 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  123. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  124. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  125. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  126. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream.d.ts +1340 -0
  127. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  128. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/test.d.ts +374 -0
  129. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers/promises.d.ts +68 -0
  130. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
  131. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tls.d.ts +1028 -0
  132. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
  133. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
  134. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/url.d.ts +897 -0
  135. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/util.d.ts +1850 -0
  136. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/v8.d.ts +396 -0
  137. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/vm.d.ts +509 -0
  138. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  139. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/worker_threads.d.ts +689 -0
  140. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  141. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +206 -0
  142. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +897 -0
  143. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1850 -0
  144. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +396 -0
  145. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +509 -0
  146. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
  147. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +689 -0
  148. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
  149. package/node_modules/@types/keyv/package.json +25 -5
  150. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  151. package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
  152. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +62 -2
  153. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/test.d.ts +62 -2
  154. package/node_modules/keyv/README.md +23 -1
  155. package/node_modules/keyv/package.json +9 -8
  156. package/node_modules/keyv/src/index.d.ts +8 -1
  157. package/node_modules/keyv/src/index.js +4 -5
  158. package/package.json +7 -9
@@ -0,0 +1,625 @@
1
+ /**
2
+ * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
3
+ * Node.js-specific performance measurements.
4
+ *
5
+ * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
6
+ *
7
+ * * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
8
+ * * [Performance Timeline](https://w3c.github.io/performance-timeline/)
9
+ * * [User Timing](https://www.w3.org/TR/user-timing/)
10
+ *
11
+ * ```js
12
+ * const { PerformanceObserver, performance } = require('perf_hooks');
13
+ *
14
+ * const obs = new PerformanceObserver((items) => {
15
+ * console.log(items.getEntries()[0].duration);
16
+ * performance.clearMarks();
17
+ * });
18
+ * obs.observe({ type: 'measure' });
19
+ * performance.measure('Start to Now');
20
+ *
21
+ * performance.mark('A');
22
+ * doSomeLongRunningProcess(() => {
23
+ * performance.measure('A to Now', 'A');
24
+ *
25
+ * performance.mark('B');
26
+ * performance.measure('A to B', 'A', 'B');
27
+ * });
28
+ * ```
29
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js)
30
+ */
31
+ declare module 'perf_hooks' {
32
+ import { AsyncResource } from 'node:async_hooks';
33
+ type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
34
+ interface NodeGCPerformanceDetail {
35
+ /**
36
+ * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
37
+ * the type of garbage collection operation that occurred.
38
+ * See perf_hooks.constants for valid values.
39
+ */
40
+ readonly kind?: number | undefined;
41
+ /**
42
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
43
+ * property contains additional information about garbage collection operation.
44
+ * See perf_hooks.constants for valid values.
45
+ */
46
+ readonly flags?: number | undefined;
47
+ }
48
+ /**
49
+ * @since v8.5.0
50
+ */
51
+ class PerformanceEntry {
52
+ protected constructor();
53
+ /**
54
+ * The total number of milliseconds elapsed for this entry. This value will not
55
+ * be meaningful for all Performance Entry types.
56
+ * @since v8.5.0
57
+ */
58
+ readonly duration: number;
59
+ /**
60
+ * The name of the performance entry.
61
+ * @since v8.5.0
62
+ */
63
+ readonly name: string;
64
+ /**
65
+ * The high resolution millisecond timestamp marking the starting time of the
66
+ * Performance Entry.
67
+ * @since v8.5.0
68
+ */
69
+ readonly startTime: number;
70
+ /**
71
+ * The type of the performance entry. It may be one of:
72
+ *
73
+ * * `'node'` (Node.js only)
74
+ * * `'mark'` (available on the Web)
75
+ * * `'measure'` (available on the Web)
76
+ * * `'gc'` (Node.js only)
77
+ * * `'function'` (Node.js only)
78
+ * * `'http2'` (Node.js only)
79
+ * * `'http'` (Node.js only)
80
+ * @since v8.5.0
81
+ */
82
+ readonly entryType: EntryType;
83
+ /**
84
+ * Additional detail specific to the `entryType`.
85
+ * @since v16.0.0
86
+ */
87
+ readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
88
+ toJSON(): any;
89
+ }
90
+ class PerformanceMark extends PerformanceEntry {
91
+ readonly duration: 0;
92
+ readonly entryType: 'mark';
93
+ }
94
+ class PerformanceMeasure extends PerformanceEntry {
95
+ readonly entryType: 'measure';
96
+ }
97
+ /**
98
+ * _This property is an extension by Node.js. It is not available in Web browsers._
99
+ *
100
+ * Provides timing details for Node.js itself. The constructor of this class
101
+ * is not exposed to users.
102
+ * @since v8.5.0
103
+ */
104
+ class PerformanceNodeTiming extends PerformanceEntry {
105
+ /**
106
+ * The high resolution millisecond timestamp at which the Node.js process
107
+ * completed bootstrapping. If bootstrapping has not yet finished, the property
108
+ * has the value of -1.
109
+ * @since v8.5.0
110
+ */
111
+ readonly bootstrapComplete: number;
112
+ /**
113
+ * The high resolution millisecond timestamp at which the Node.js environment was
114
+ * initialized.
115
+ * @since v8.5.0
116
+ */
117
+ readonly environment: number;
118
+ /**
119
+ * The high resolution millisecond timestamp of the amount of time the event loop
120
+ * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
121
+ * does not take CPU usage into consideration. If the event loop has not yet
122
+ * started (e.g., in the first tick of the main script), the property has the
123
+ * value of 0.
124
+ * @since v14.10.0, v12.19.0
125
+ */
126
+ readonly idleTime: number;
127
+ /**
128
+ * The high resolution millisecond timestamp at which the Node.js event loop
129
+ * exited. If the event loop has not yet exited, the property has the value of -1\.
130
+ * It can only have a value of not -1 in a handler of the `'exit'` event.
131
+ * @since v8.5.0
132
+ */
133
+ readonly loopExit: number;
134
+ /**
135
+ * The high resolution millisecond timestamp at which the Node.js event loop
136
+ * started. If the event loop has not yet started (e.g., in the first tick of the
137
+ * main script), the property has the value of -1.
138
+ * @since v8.5.0
139
+ */
140
+ readonly loopStart: number;
141
+ /**
142
+ * The high resolution millisecond timestamp at which the V8 platform was
143
+ * initialized.
144
+ * @since v8.5.0
145
+ */
146
+ readonly v8Start: number;
147
+ }
148
+ interface EventLoopUtilization {
149
+ idle: number;
150
+ active: number;
151
+ utilization: number;
152
+ }
153
+ /**
154
+ * @param util1 The result of a previous call to eventLoopUtilization()
155
+ * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
156
+ */
157
+ type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
158
+ interface MarkOptions {
159
+ /**
160
+ * Additional optional detail to include with the mark.
161
+ */
162
+ detail?: unknown | undefined;
163
+ /**
164
+ * An optional timestamp to be used as the mark time.
165
+ * @default `performance.now()`.
166
+ */
167
+ startTime?: number | undefined;
168
+ }
169
+ interface MeasureOptions {
170
+ /**
171
+ * Additional optional detail to include with the mark.
172
+ */
173
+ detail?: unknown | undefined;
174
+ /**
175
+ * Duration between start and end times.
176
+ */
177
+ duration?: number | undefined;
178
+ /**
179
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
180
+ */
181
+ end?: number | string | undefined;
182
+ /**
183
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
184
+ */
185
+ start?: number | string | undefined;
186
+ }
187
+ interface TimerifyOptions {
188
+ /**
189
+ * A histogram object created using
190
+ * `perf_hooks.createHistogram()` that will record runtime durations in
191
+ * nanoseconds.
192
+ */
193
+ histogram?: RecordableHistogram | undefined;
194
+ }
195
+ interface Performance {
196
+ /**
197
+ * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
198
+ * If name is provided, removes only the named mark.
199
+ * @param name
200
+ */
201
+ clearMarks(name?: string): void;
202
+ /**
203
+ * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
204
+ * If name is provided, removes only the named measure.
205
+ * @param name
206
+ * @since v16.7.0
207
+ */
208
+ clearMeasures(name?: string): void;
209
+ /**
210
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
211
+ * If you are only interested in performance entries of certain types or that have certain names, see
212
+ * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
213
+ * @since v16.7.0
214
+ */
215
+ getEntries(): PerformanceEntry[];
216
+ /**
217
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
218
+ * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
219
+ * @param name
220
+ * @param type
221
+ * @since v16.7.0
222
+ */
223
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
224
+ /**
225
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
226
+ * whose `performanceEntry.entryType` is equal to `type`.
227
+ * @param type
228
+ * @since v16.7.0
229
+ */
230
+ getEntriesByType(type: EntryType): PerformanceEntry[];
231
+ /**
232
+ * Creates a new PerformanceMark entry in the Performance Timeline.
233
+ * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
234
+ * and whose performanceEntry.duration is always 0.
235
+ * Performance marks are used to mark specific significant moments in the Performance Timeline.
236
+ * @param name
237
+ * @return The PerformanceMark entry that was created
238
+ */
239
+ mark(name?: string, options?: MarkOptions): PerformanceMark;
240
+ /**
241
+ * Creates a new PerformanceMeasure entry in the Performance Timeline.
242
+ * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
243
+ * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
244
+ *
245
+ * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
246
+ * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
247
+ * then startMark is set to timeOrigin by default.
248
+ *
249
+ * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
250
+ * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
251
+ * @param name
252
+ * @param startMark
253
+ * @param endMark
254
+ * @return The PerformanceMeasure entry that was created
255
+ */
256
+ measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
257
+ measure(name: string, options: MeasureOptions): PerformanceMeasure;
258
+ /**
259
+ * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
260
+ */
261
+ readonly nodeTiming: PerformanceNodeTiming;
262
+ /**
263
+ * @return the current high resolution millisecond timestamp
264
+ */
265
+ now(): number;
266
+ /**
267
+ * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
268
+ */
269
+ readonly timeOrigin: number;
270
+ /**
271
+ * Wraps a function within a new function that measures the running time of the wrapped function.
272
+ * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
273
+ * @param fn
274
+ */
275
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
276
+ /**
277
+ * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
278
+ * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
279
+ * No other CPU idle time is taken into consideration.
280
+ */
281
+ eventLoopUtilization: EventLoopUtilityFunction;
282
+ }
283
+ interface PerformanceObserverEntryList {
284
+ /**
285
+ * Returns a list of `PerformanceEntry` objects in chronological order
286
+ * with respect to `performanceEntry.startTime`.
287
+ *
288
+ * ```js
289
+ * const {
290
+ * performance,
291
+ * PerformanceObserver
292
+ * } = require('perf_hooks');
293
+ *
294
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
295
+ * console.log(perfObserverList.getEntries());
296
+ *
297
+ * * [
298
+ * * PerformanceEntry {
299
+ * * name: 'test',
300
+ * * entryType: 'mark',
301
+ * * startTime: 81.465639,
302
+ * * duration: 0
303
+ * * },
304
+ * * PerformanceEntry {
305
+ * * name: 'meow',
306
+ * * entryType: 'mark',
307
+ * * startTime: 81.860064,
308
+ * * duration: 0
309
+ * * }
310
+ * * ]
311
+ *
312
+ *
313
+ * performance.clearMarks();
314
+ * performance.clearMeasures();
315
+ * observer.disconnect();
316
+ * });
317
+ * obs.observe({ type: 'mark' });
318
+ *
319
+ * performance.mark('test');
320
+ * performance.mark('meow');
321
+ * ```
322
+ * @since v8.5.0
323
+ */
324
+ getEntries(): PerformanceEntry[];
325
+ /**
326
+ * Returns a list of `PerformanceEntry` objects in chronological order
327
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
328
+ * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
329
+ *
330
+ * ```js
331
+ * const {
332
+ * performance,
333
+ * PerformanceObserver
334
+ * } = require('perf_hooks');
335
+ *
336
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
337
+ * console.log(perfObserverList.getEntriesByName('meow'));
338
+ *
339
+ * * [
340
+ * * PerformanceEntry {
341
+ * * name: 'meow',
342
+ * * entryType: 'mark',
343
+ * * startTime: 98.545991,
344
+ * * duration: 0
345
+ * * }
346
+ * * ]
347
+ *
348
+ * console.log(perfObserverList.getEntriesByName('nope')); // []
349
+ *
350
+ * console.log(perfObserverList.getEntriesByName('test', 'mark'));
351
+ *
352
+ * * [
353
+ * * PerformanceEntry {
354
+ * * name: 'test',
355
+ * * entryType: 'mark',
356
+ * * startTime: 63.518931,
357
+ * * duration: 0
358
+ * * }
359
+ * * ]
360
+ *
361
+ * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
362
+ *
363
+ * performance.clearMarks();
364
+ * performance.clearMeasures();
365
+ * observer.disconnect();
366
+ * });
367
+ * obs.observe({ entryTypes: ['mark', 'measure'] });
368
+ *
369
+ * performance.mark('test');
370
+ * performance.mark('meow');
371
+ * ```
372
+ * @since v8.5.0
373
+ */
374
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
375
+ /**
376
+ * Returns a list of `PerformanceEntry` objects in chronological order
377
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
378
+ *
379
+ * ```js
380
+ * const {
381
+ * performance,
382
+ * PerformanceObserver
383
+ * } = require('perf_hooks');
384
+ *
385
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
386
+ * console.log(perfObserverList.getEntriesByType('mark'));
387
+ *
388
+ * * [
389
+ * * PerformanceEntry {
390
+ * * name: 'test',
391
+ * * entryType: 'mark',
392
+ * * startTime: 55.897834,
393
+ * * duration: 0
394
+ * * },
395
+ * * PerformanceEntry {
396
+ * * name: 'meow',
397
+ * * entryType: 'mark',
398
+ * * startTime: 56.350146,
399
+ * * duration: 0
400
+ * * }
401
+ * * ]
402
+ *
403
+ * performance.clearMarks();
404
+ * performance.clearMeasures();
405
+ * observer.disconnect();
406
+ * });
407
+ * obs.observe({ type: 'mark' });
408
+ *
409
+ * performance.mark('test');
410
+ * performance.mark('meow');
411
+ * ```
412
+ * @since v8.5.0
413
+ */
414
+ getEntriesByType(type: EntryType): PerformanceEntry[];
415
+ }
416
+ type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
417
+ class PerformanceObserver extends AsyncResource {
418
+ constructor(callback: PerformanceObserverCallback);
419
+ /**
420
+ * Disconnects the `PerformanceObserver` instance from all notifications.
421
+ * @since v8.5.0
422
+ */
423
+ disconnect(): void;
424
+ /**
425
+ * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`:
426
+ *
427
+ * ```js
428
+ * const {
429
+ * performance,
430
+ * PerformanceObserver
431
+ * } = require('perf_hooks');
432
+ *
433
+ * const obs = new PerformanceObserver((list, observer) => {
434
+ * // Called once asynchronously. `list` contains three items.
435
+ * });
436
+ * obs.observe({ type: 'mark' });
437
+ *
438
+ * for (let n = 0; n < 3; n++)
439
+ * performance.mark(`test${n}`);
440
+ * ```
441
+ * @since v8.5.0
442
+ */
443
+ observe(
444
+ options:
445
+ | {
446
+ entryTypes: ReadonlyArray<EntryType>;
447
+ buffered?: boolean | undefined;
448
+ }
449
+ | {
450
+ type: EntryType;
451
+ buffered?: boolean | undefined;
452
+ }
453
+ ): void;
454
+ }
455
+ namespace constants {
456
+ const NODE_PERFORMANCE_GC_MAJOR: number;
457
+ const NODE_PERFORMANCE_GC_MINOR: number;
458
+ const NODE_PERFORMANCE_GC_INCREMENTAL: number;
459
+ const NODE_PERFORMANCE_GC_WEAKCB: number;
460
+ const NODE_PERFORMANCE_GC_FLAGS_NO: number;
461
+ const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
462
+ const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
463
+ const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
464
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
465
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
466
+ const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
467
+ }
468
+ const performance: Performance;
469
+ interface EventLoopMonitorOptions {
470
+ /**
471
+ * The sampling rate in milliseconds.
472
+ * Must be greater than zero.
473
+ * @default 10
474
+ */
475
+ resolution?: number | undefined;
476
+ }
477
+ interface Histogram {
478
+ /**
479
+ * Returns a `Map` object detailing the accumulated percentile distribution.
480
+ * @since v11.10.0
481
+ */
482
+ readonly percentiles: Map<number, number>;
483
+ /**
484
+ * The number of times the event loop delay exceeded the maximum 1 hour event
485
+ * loop delay threshold.
486
+ * @since v11.10.0
487
+ */
488
+ readonly exceeds: number;
489
+ /**
490
+ * The minimum recorded event loop delay.
491
+ * @since v11.10.0
492
+ */
493
+ readonly min: number;
494
+ /**
495
+ * The maximum recorded event loop delay.
496
+ * @since v11.10.0
497
+ */
498
+ readonly max: number;
499
+ /**
500
+ * The mean of the recorded event loop delays.
501
+ * @since v11.10.0
502
+ */
503
+ readonly mean: number;
504
+ /**
505
+ * The standard deviation of the recorded event loop delays.
506
+ * @since v11.10.0
507
+ */
508
+ readonly stddev: number;
509
+ /**
510
+ * Resets the collected histogram data.
511
+ * @since v11.10.0
512
+ */
513
+ reset(): void;
514
+ /**
515
+ * Returns the value at the given percentile.
516
+ * @since v11.10.0
517
+ * @param percentile A percentile value in the range (0, 100].
518
+ */
519
+ percentile(percentile: number): number;
520
+ }
521
+ interface IntervalHistogram extends Histogram {
522
+ /**
523
+ * Enables the update interval timer. Returns `true` if the timer was
524
+ * started, `false` if it was already started.
525
+ * @since v11.10.0
526
+ */
527
+ enable(): boolean;
528
+ /**
529
+ * Disables the update interval timer. Returns `true` if the timer was
530
+ * stopped, `false` if it was already stopped.
531
+ * @since v11.10.0
532
+ */
533
+ disable(): boolean;
534
+ }
535
+ interface RecordableHistogram extends Histogram {
536
+ /**
537
+ * @since v15.9.0, v14.18.0
538
+ * @param val The amount to record in the histogram.
539
+ */
540
+ record(val: number | bigint): void;
541
+ /**
542
+ * Calculates the amount of time (in nanoseconds) that has passed since the
543
+ * previous call to `recordDelta()` and records that amount in the histogram.
544
+ *
545
+ * ## Examples
546
+ * @since v15.9.0, v14.18.0
547
+ */
548
+ recordDelta(): void;
549
+ /**
550
+ * Adds the values from other to this histogram.
551
+ * @since v17.4.0, v16.14.0
552
+ * @param other Recordable Histogram to combine with
553
+ */
554
+ add(other: RecordableHistogram): void;
555
+ }
556
+ /**
557
+ * _This property is an extension by Node.js. It is not available in Web browsers._
558
+ *
559
+ * Creates an `IntervalHistogram` object that samples and reports the event loop
560
+ * delay over time. The delays will be reported in nanoseconds.
561
+ *
562
+ * Using a timer to detect approximate event loop delay works because the
563
+ * execution of timers is tied specifically to the lifecycle of the libuv
564
+ * event loop. That is, a delay in the loop will cause a delay in the execution
565
+ * of the timer, and those delays are specifically what this API is intended to
566
+ * detect.
567
+ *
568
+ * ```js
569
+ * const { monitorEventLoopDelay } = require('perf_hooks');
570
+ * const h = monitorEventLoopDelay({ resolution: 20 });
571
+ * h.enable();
572
+ * // Do something.
573
+ * h.disable();
574
+ * console.log(h.min);
575
+ * console.log(h.max);
576
+ * console.log(h.mean);
577
+ * console.log(h.stddev);
578
+ * console.log(h.percentiles);
579
+ * console.log(h.percentile(50));
580
+ * console.log(h.percentile(99));
581
+ * ```
582
+ * @since v11.10.0
583
+ */
584
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
585
+ interface CreateHistogramOptions {
586
+ /**
587
+ * The minimum recordable value. Must be an integer value greater than 0.
588
+ * @default 1
589
+ */
590
+ min?: number | bigint | undefined;
591
+ /**
592
+ * The maximum recordable value. Must be an integer value greater than min.
593
+ * @default Number.MAX_SAFE_INTEGER
594
+ */
595
+ max?: number | bigint | undefined;
596
+ /**
597
+ * The number of accuracy digits. Must be a number between 1 and 5.
598
+ * @default 3
599
+ */
600
+ figures?: number | undefined;
601
+ }
602
+ /**
603
+ * Returns a `RecordableHistogram`.
604
+ * @since v15.9.0, v14.18.0
605
+ */
606
+ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
607
+
608
+ import { performance as _performance } from 'perf_hooks';
609
+ global {
610
+ /**
611
+ * `performance` is a global reference for `require('perf_hooks').performance`
612
+ * https://nodejs.org/api/globals.html#performance
613
+ * @since v16.0.0
614
+ */
615
+ var performance: typeof globalThis extends {
616
+ onmessage: any;
617
+ performance: infer T;
618
+ }
619
+ ? T
620
+ : typeof _performance;
621
+ }
622
+ }
623
+ declare module 'node:perf_hooks' {
624
+ export * from 'perf_hooks';
625
+ }