profiler-md 0.3.0 → 0.4.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/dist/cli/index.mjs +2607 -1927
- package/dist/index.d.mts +157 -219
- package/dist/index.js +2 -2
- package/docs/formats/collapsed.md +12 -0
- package/docs/languages/cpp.md +136 -0
- package/docs/languages/csharp.md +49 -0
- package/docs/languages/elixir.md +42 -0
- package/docs/languages/erlang.md +42 -0
- package/docs/languages/fsharp.md +49 -0
- package/docs/languages/java.md +10 -7
- package/docs/languages/javascript.md +35 -0
- package/docs/languages/julia.md +42 -0
- package/docs/languages/kotlin.md +120 -0
- package/docs/languages/python.md +10 -4
- package/docs/languages/typescript.md +254 -0
- package/examples/bun.cpuprofile.md +33 -33
- package/examples/deno.cpuprofile.md +9 -9
- package/examples/jsc-heap-snapshot.base.json.md +507 -0
- package/examples/jsc-heap-snapshot.current.json.md +504 -0
- package/examples/jsc-heap-snapshot.diff.json.md +119 -0
- package/examples/node.base.cpuprofile.md +451 -0
- package/examples/node.current.cpuprofile.md +449 -0
- package/examples/node.diff.cpuprofile.md +82 -0
- package/examples/node.heapprofile.md +33 -33
- package/examples/node.heapsnapshot.md +46 -46
- package/examples/node.pprof.md +3 -3
- package/examples/python.base.collapsed.md +116 -0
- package/examples/python.current.collapsed.md +125 -0
- package/examples/python.diff.collapsed.md +51 -0
- package/examples/{rust.pprof.md → rust.base.pprof.md} +199 -199
- package/examples/rust.current.pprof.md +480 -0
- package/examples/rust.diff.pprof.md +117 -0
- package/examples/webkit-timeline-recording.json.md +296 -296
- package/package.json +21 -18
- package/readme.md +106 -80
- package/examples/jsc-heap-snapshot.json.md +0 -509
- package/examples/node.cpuprofile.md +0 -485
- package/examples/node.speedscope.json.md +0 -408
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RawSourceMap as SourceMap } from "source-map-js";
|
|
2
|
+
|
|
2
3
|
//#region src/helpers/types.d.ts
|
|
3
4
|
type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
|
|
4
5
|
/**
|
|
@@ -8,14 +9,69 @@ type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint
|
|
|
8
9
|
type DeepReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, DeepReadonly<V>> : T extends Set<infer V> ? ReadonlySet<DeepReadonly<V>> : T extends TypedArray ? Readonly<T> : T extends (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
|
|
9
10
|
//#endregion
|
|
10
11
|
//#region src/location.d.ts
|
|
11
|
-
/** A
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
line?: number; /** The 1-based column number in the file at {@link ProfileLocation.url}. */
|
|
12
|
+
/** A file reference, potentially with line and column information. */
|
|
13
|
+
type SourceLocation = FileReference & {
|
|
14
|
+
/** The 1-based line number in the file. */line?: number; /** The 1-based column number in the file. */
|
|
15
15
|
column?: number;
|
|
16
16
|
};
|
|
17
|
+
declare const fileReferenceId: (fileReference: DeepReadonly<FileReference>) => string;
|
|
18
|
+
type FileReference = {
|
|
19
|
+
type: `absolute`;
|
|
20
|
+
url: URL;
|
|
21
|
+
} | {
|
|
22
|
+
type: `relative`;
|
|
23
|
+
path: string;
|
|
24
|
+
};
|
|
17
25
|
//#endregion
|
|
18
26
|
//#region src/profile/aggregate.d.ts
|
|
27
|
+
/** An aggregation of samples taken at a given line within a function's body. */
|
|
28
|
+
type AggregatedProfileLineMetrics = {
|
|
29
|
+
/**
|
|
30
|
+
* The number of samples taken directly within the function's body at this
|
|
31
|
+
* line.
|
|
32
|
+
*/
|
|
33
|
+
sampleCount: number;
|
|
34
|
+
/**
|
|
35
|
+
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
36
|
+
* samples taken directly within the function's body at this line.
|
|
37
|
+
*/
|
|
38
|
+
values: Float64Array;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* An aggregation of samples taken directly within a function's body with a
|
|
42
|
+
* given direct caller.
|
|
43
|
+
*/
|
|
44
|
+
type AggregatedProfileCallerMetrics = {
|
|
45
|
+
/** The caller corresponding to the ID. */caller: AggregatedProfileFunction;
|
|
46
|
+
/**
|
|
47
|
+
* The number of samples taken directly within the function's body with this
|
|
48
|
+
* caller.
|
|
49
|
+
*/
|
|
50
|
+
selfSampleCount: number;
|
|
51
|
+
/**
|
|
52
|
+
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
53
|
+
* samples taken directly within the function's body with this caller.
|
|
54
|
+
*/
|
|
55
|
+
selfValues: Float64Array;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* An aggregation of samples taken within a function's body, _and_ all its
|
|
59
|
+
* callees, with a given direct callee.
|
|
60
|
+
*/
|
|
61
|
+
type AggregatedProfileCalleeMetrics = {
|
|
62
|
+
/** The callee corresponding to the ordinal. */callee: AggregatedProfileFunction;
|
|
63
|
+
/**
|
|
64
|
+
* The number of samples taken directly within the function's, _and_ all
|
|
65
|
+
* its callees, with this callee.
|
|
66
|
+
*/
|
|
67
|
+
totalSampleCount: number;
|
|
68
|
+
/**
|
|
69
|
+
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
70
|
+
* samples taken directly within the function's body, _and_ all its
|
|
71
|
+
* callees. with this callee.
|
|
72
|
+
*/
|
|
73
|
+
totalValues: Float64Array;
|
|
74
|
+
};
|
|
19
75
|
/**
|
|
20
76
|
* An aggregation of data from every sample involving a given function within a
|
|
21
77
|
* profile.
|
|
@@ -24,7 +80,7 @@ type AggregatedProfileFunction = {
|
|
|
24
80
|
type: `function`; /** An index that uniquely identifies this function. */
|
|
25
81
|
id: number; /** The name of the function in code. */
|
|
26
82
|
name: string; /** Where the function was defined, if known. */
|
|
27
|
-
location?:
|
|
83
|
+
location?: SourceLocation; /** A string describing the category of functions this function belongs to.*/
|
|
28
84
|
category: string;
|
|
29
85
|
/**
|
|
30
86
|
* The number of samples taken directly within the function's body, excluding
|
|
@@ -46,53 +102,17 @@ type AggregatedProfileFunction = {
|
|
|
46
102
|
* taken directly within the function's body _and_ all its callees.
|
|
47
103
|
*/
|
|
48
104
|
totalValues: Float64Array; /** 1-based line number to values and sample count for that line. */
|
|
49
|
-
lineToMetrics: Map<number,
|
|
50
|
-
/**
|
|
51
|
-
* The number of samples taken directly within the function's body at this
|
|
52
|
-
* line.
|
|
53
|
-
*/
|
|
54
|
-
sampleCount: number;
|
|
55
|
-
/**
|
|
56
|
-
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
57
|
-
* samples taken directly within the function's body at this line.
|
|
58
|
-
*/
|
|
59
|
-
values: Float64Array;
|
|
60
|
-
}>;
|
|
105
|
+
lineToMetrics: Map<number, AggregatedProfileLineMetrics>;
|
|
61
106
|
/**
|
|
62
107
|
* Direct caller id to values and sample count with that caller's calls to
|
|
63
108
|
* this function.
|
|
64
109
|
*/
|
|
65
|
-
callerIdToMetrics: Map<number,
|
|
66
|
-
/** The caller corresponding to the ID. */caller: AggregatedProfileFunction;
|
|
67
|
-
/**
|
|
68
|
-
* The number of samples taken directly within the function's body with
|
|
69
|
-
* this caller.
|
|
70
|
-
*/
|
|
71
|
-
selfSampleCount: number;
|
|
72
|
-
/**
|
|
73
|
-
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
74
|
-
* samples taken directly within the function's body with this caller.
|
|
75
|
-
*/
|
|
76
|
-
selfValues: Float64Array;
|
|
77
|
-
}>;
|
|
110
|
+
callerIdToMetrics: Map<number, AggregatedProfileCallerMetrics>;
|
|
78
111
|
/**
|
|
79
112
|
* Direct callee id to values and sample count for that callee's calls where
|
|
80
113
|
* this function was a direct or transitive caller.
|
|
81
114
|
*/
|
|
82
|
-
calleeIdToMetrics: Map<number,
|
|
83
|
-
/** The callee corresponding to the ordinal. */callee: AggregatedProfileFunction;
|
|
84
|
-
/**
|
|
85
|
-
* The number of samples taken directly within the function's, _and_ all
|
|
86
|
-
* its callees, with this callee.
|
|
87
|
-
*/
|
|
88
|
-
totalSampleCount: number;
|
|
89
|
-
/**
|
|
90
|
-
* For each metric in {@link AggregatedProfile.metrics}, the sum of values from
|
|
91
|
-
* samples taken directly within the function's body, _and_ all its
|
|
92
|
-
* callees. with this callee.
|
|
93
|
-
*/
|
|
94
|
-
totalValues: Float64Array;
|
|
95
|
-
}>;
|
|
115
|
+
calleeIdToMetrics: Map<number, AggregatedProfileCalleeMetrics>;
|
|
96
116
|
};
|
|
97
117
|
//#endregion
|
|
98
118
|
//#region src/snapshot/aggregate.d.ts
|
|
@@ -106,18 +126,23 @@ type AggregatedSnapshotNode = {
|
|
|
106
126
|
* the node were garbage collected.
|
|
107
127
|
*/
|
|
108
128
|
retainedSize: number; /** The exact location where the node was defined. */
|
|
109
|
-
location?:
|
|
129
|
+
location?: SourceLocation;
|
|
110
130
|
};
|
|
111
131
|
//#endregion
|
|
112
132
|
//#region src/options.d.ts
|
|
113
133
|
/** Profile data that can be synchronously parsed and converted to Markdown. */
|
|
114
|
-
type
|
|
115
|
-
/**
|
|
116
|
-
* JSON profile data that can be synchronously parsed and converted to Markdown.
|
|
117
|
-
*/
|
|
118
|
-
type JsonProfileData = string | BinaryProfileData;
|
|
134
|
+
type ProfileData = string | Uint8Array | Iterable<Uint8Array>;
|
|
119
135
|
/** Profile data that can be asynchronously parsed and converted to Markdown. */
|
|
120
136
|
type AsyncProfileData = Blob | ReadableStream<Uint8Array>;
|
|
137
|
+
/**
|
|
138
|
+
* Profile data with or without an explicit format.
|
|
139
|
+
*
|
|
140
|
+
* The format is auto-detected if no format is specified.
|
|
141
|
+
*/
|
|
142
|
+
type ProfileInput<Data> = Data | {
|
|
143
|
+
data: Data;
|
|
144
|
+
format: Format;
|
|
145
|
+
};
|
|
121
146
|
/** The category of code an entry originated from. */
|
|
122
147
|
type EntryOrigin = `ours` | `stdlib` | `third-party`;
|
|
123
148
|
/** A single entry in a rendered profile. */
|
|
@@ -132,7 +157,21 @@ type ProfileEntry = {
|
|
|
132
157
|
* The location where the entity corresponding to this entry was defined, or
|
|
133
158
|
* undefined if it's unknown.
|
|
134
159
|
*/
|
|
135
|
-
location?:
|
|
160
|
+
location?: SourceLocation;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Normalized entry fields used to match an entry across diffed profiles.
|
|
164
|
+
*
|
|
165
|
+
* Only affects matching; the entry's displayed name and location are
|
|
166
|
+
* unchanged.
|
|
167
|
+
*/
|
|
168
|
+
type NormalizedEntry = {
|
|
169
|
+
/** The name to match by. Omit to match by the entry's name. */name?: string;
|
|
170
|
+
/**
|
|
171
|
+
* The location to match by, as a URL or file path string. Omit to match by
|
|
172
|
+
* the entry's location.
|
|
173
|
+
*/
|
|
174
|
+
location?: string;
|
|
136
175
|
};
|
|
137
176
|
/** A aggregated entry in a rendered profile. */
|
|
138
177
|
type AggregatedProfileEntry = AggregatedProfileFunction | AggregatedSnapshotNode;
|
|
@@ -148,27 +187,17 @@ type ProfileToMdOptions = {
|
|
|
148
187
|
*/
|
|
149
188
|
topN?: number;
|
|
150
189
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* Used to compute a category breakdown in the Markdown output.
|
|
154
|
-
*/
|
|
155
|
-
categorizeEntry?: (entry: DeepReadonly<ProfileEntry>) => EntryOrigin | (string & {});
|
|
156
|
-
/**
|
|
157
|
-
* Whether to include the given entry in the Markdown output.
|
|
190
|
+
* Base URL to show paths relative to in the Markdown output.
|
|
158
191
|
*
|
|
159
|
-
*
|
|
160
|
-
|
|
161
|
-
showEntry?: (entry: DeepReadonly<AggregatedProfileEntry>) => boolean;
|
|
162
|
-
/**
|
|
163
|
-
* The current working directory to use to make file paths relative in the
|
|
164
|
-
* Markdown output.
|
|
192
|
+
* Accepts an absolute file path string or URL. File paths are converted to
|
|
193
|
+
* `file://` URLs internally.
|
|
165
194
|
*
|
|
166
|
-
* A value of `null` indicates that
|
|
195
|
+
* A value of `null` indicates that URLs should be absolute.
|
|
167
196
|
*
|
|
168
197
|
* Defaults to `process.cwd()` when available. Otherwise leaves paths
|
|
169
198
|
* absolute.
|
|
170
199
|
*/
|
|
171
|
-
|
|
200
|
+
baseURL?: string | URL | null;
|
|
172
201
|
/**
|
|
173
202
|
* Source maps to apply when rendering profile locations.
|
|
174
203
|
*
|
|
@@ -179,7 +208,41 @@ type ProfileToMdOptions = {
|
|
|
179
208
|
* map's `file` field (and optionally `sourceRoot`).
|
|
180
209
|
*/
|
|
181
210
|
sourceMaps?: SourceMap[] | Record<string, SourceMap>;
|
|
211
|
+
/**
|
|
212
|
+
* Returns a normalized name and location to match this entry by across
|
|
213
|
+
* diffed profiles, or `undefined` to match by the entry's own name and
|
|
214
|
+
* location.
|
|
215
|
+
*
|
|
216
|
+
* Only affects which entries are considered the same entity when diffing
|
|
217
|
+
* (profile functions and snapshot closures); displayed names and locations,
|
|
218
|
+
* categorization, and source map resolution always use the entry's real
|
|
219
|
+
* name and location. Matched entries display the current profile's name and
|
|
220
|
+
* location.
|
|
221
|
+
*
|
|
222
|
+
* Defaults to {@link defaultMatchEntry}, which strips known build hashes from
|
|
223
|
+
* locations so that the same function matches across profiles built from the
|
|
224
|
+
* same source.
|
|
225
|
+
*/
|
|
226
|
+
matchEntry?: (entry: DeepReadonly<ProfileEntry>) => NormalizedEntry | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* Returns an arbitrary category string for this entry.
|
|
229
|
+
*
|
|
230
|
+
* Used to compute a category breakdown in the Markdown output.
|
|
231
|
+
*/
|
|
232
|
+
categorizeEntry?: (entry: DeepReadonly<ProfileEntry>) => EntryOrigin | (string & {});
|
|
233
|
+
/**
|
|
234
|
+
* Whether to include the given entry in the Markdown output.
|
|
235
|
+
*
|
|
236
|
+
* Not showing an entry does not exclude it from metric computations.
|
|
237
|
+
*/
|
|
238
|
+
showEntry?: (entry: DeepReadonly<AggregatedProfileEntry>) => boolean;
|
|
182
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* Returns a location to match this entry by with known build hashes (Cargo
|
|
242
|
+
* build-script and rustc commit-hash directories) stripped, or `undefined` if
|
|
243
|
+
* the location contains no known hashes.
|
|
244
|
+
*/
|
|
245
|
+
declare const defaultMatchEntry: (entry: DeepReadonly<ProfileEntry>) => NormalizedEntry | undefined;
|
|
183
246
|
/**
|
|
184
247
|
* Returns an arbitrary category string for this entry.
|
|
185
248
|
*
|
|
@@ -209,173 +272,48 @@ declare const isSyntheticEntry: ({
|
|
|
209
272
|
*
|
|
210
273
|
* These entries are typically implementation details of external code that your
|
|
211
274
|
* own code cannot directly call. Excluding these entries from the Markdown
|
|
212
|
-
* leaves only your code and the public API surface of stdlib and
|
|
213
|
-
* code.
|
|
214
|
-
*/
|
|
215
|
-
declare const isExternalPrivateEntry: (entry: DeepReadonly<AggregatedProfileEntry>) => boolean;
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/formats/jsc-heap-snapshot/index.d.ts
|
|
218
|
-
/**
|
|
219
|
-
* Converts the given JSC heap snapshot to Markdown.
|
|
220
|
-
*
|
|
221
|
-
* It is assumed that {@link data} is a valid snapshot. The behavior of this
|
|
222
|
-
* function is undefined for invalid snapshots.
|
|
223
|
-
*
|
|
224
|
-
* See the [JSC heap snapshot docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/jsc-heap-snapshot.md)
|
|
225
|
-
* for supported runtimes and generation instructions
|
|
226
|
-
* (`profiler-md --help jsc-heap-snapshot`).
|
|
227
|
-
*/
|
|
228
|
-
declare const jscHeapSnapshotToMd: (data: JsonProfileData, options?: ProfileToMdOptions) => string;
|
|
229
|
-
/**
|
|
230
|
-
* Asynchronously converts the given JSC heap snapshot to Markdown.
|
|
231
|
-
*
|
|
232
|
-
* It is assumed that {@link data} is a valid snapshot. The behavior of this
|
|
233
|
-
* function is undefined for invalid snapshots.
|
|
234
|
-
*
|
|
235
|
-
* See the [JSC heap snapshot docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/jsc-heap-snapshot.md)
|
|
236
|
-
* for supported runtimes and generation instructions
|
|
237
|
-
* (`profiler-md --help jsc-heap-snapshot`).
|
|
238
|
-
*/
|
|
239
|
-
declare const jscHeapSnapshotToMdAsync: (data: AsyncProfileData, options?: ProfileToMdOptions) => Promise<string>;
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/formats/pprof/index.d.ts
|
|
242
|
-
/**
|
|
243
|
-
* Converts the given pprof to Markdown.
|
|
244
|
-
*
|
|
245
|
-
* It is assumed that {@link data} is a valid pprof (raw protobuf). The behavior
|
|
246
|
-
* of this function is undefined for invalid profiles.
|
|
247
|
-
*
|
|
248
|
-
* See the [pprof docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/pprof.md)
|
|
249
|
-
* for supported tools and generation instructions (`profiler-md --help pprof`).
|
|
250
|
-
*/
|
|
251
|
-
declare const pprofToMd: (data: BinaryProfileData, options?: ProfileToMdOptions) => string;
|
|
252
|
-
/**
|
|
253
|
-
* Asynchronously converts the given pprof to Markdown.
|
|
254
|
-
*
|
|
255
|
-
* It is assumed that {@link data} is a valid pprof (raw protobuf). The behavior
|
|
256
|
-
* of this function is undefined for invalid profiles.
|
|
257
|
-
*
|
|
258
|
-
* See the [pprof docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/pprof.md)
|
|
259
|
-
* for supported tools and generation instructions (`profiler-md --help pprof`).
|
|
260
|
-
*/
|
|
261
|
-
declare const pprofToMdAsync: (data: AsyncProfileData, options?: ProfileToMdOptions) => Promise<string>;
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/formats/speedscope/index.d.ts
|
|
264
|
-
/**
|
|
265
|
-
* Converts the given Speedscope profile to Markdown.
|
|
266
|
-
*
|
|
267
|
-
* It is assumed that {@link data} is a valid Speedscope JSON file. The behavior
|
|
268
|
-
* of this function is undefined for invalid profiles.
|
|
269
|
-
*
|
|
270
|
-
* See the [Speedscope docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/speedscope.md)
|
|
271
|
-
* for supported tools and generation instructions
|
|
272
|
-
* (`profiler-md --help speedscope`).
|
|
273
|
-
*/
|
|
274
|
-
declare const speedscopeProfileToMd: (data: JsonProfileData, options?: ProfileToMdOptions) => string;
|
|
275
|
-
/**
|
|
276
|
-
* Asynchronously converts the given Speedscope profile to Markdown.
|
|
277
|
-
*
|
|
278
|
-
* It is assumed that {@link data} is a valid Speedscope JSON file. The behavior
|
|
279
|
-
* of this function is undefined for invalid profiles.
|
|
280
|
-
*
|
|
281
|
-
* See the [Speedscope docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/speedscope.md)
|
|
282
|
-
* for supported tools and generation instructions
|
|
283
|
-
* (`profiler-md --help speedscope`).
|
|
284
|
-
*/
|
|
285
|
-
declare const speedscopeProfileToMdAsync: (data: AsyncProfileData, options?: ProfileToMdOptions) => Promise<string>;
|
|
286
|
-
//#endregion
|
|
287
|
-
//#region src/formats/v8/cpu-profile/index.d.ts
|
|
288
|
-
/**
|
|
289
|
-
* Converts the given V8 CPU profile to Markdown.
|
|
290
|
-
*
|
|
291
|
-
* It is assumed that {@link data} is a valid profile. The behavior of this
|
|
292
|
-
* function is undefined for invalid profiles.
|
|
293
|
-
*
|
|
294
|
-
* See the [V8 CPU profile docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/v8-cpu-profile.md)
|
|
295
|
-
* for supported runtimes and generation instructions
|
|
296
|
-
* (`profiler-md --help v8-cpu-profile`).
|
|
297
|
-
*/
|
|
298
|
-
declare const v8CpuProfileToMd: (data: JsonProfileData, options?: ProfileToMdOptions) => string;
|
|
299
|
-
/**
|
|
300
|
-
* Asynchronously converts the given V8 CPU profile to Markdown.
|
|
301
|
-
*
|
|
302
|
-
* It is assumed that {@link data} is a valid profile. The behavior of this
|
|
303
|
-
* function is undefined for invalid profiles.
|
|
304
|
-
*
|
|
305
|
-
* See the [V8 CPU profile docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/v8-cpu-profile.md)
|
|
306
|
-
* for supported runtimes and generation instructions
|
|
307
|
-
* (`profiler-md --help v8-cpu-profile`).
|
|
308
|
-
*/
|
|
309
|
-
declare const v8CpuProfileToMdAsync: (data: AsyncProfileData, options?: ProfileToMdOptions) => Promise<string>;
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/formats/v8/heap-profile/index.d.ts
|
|
312
|
-
/**
|
|
313
|
-
* Converts the given V8 sampling heap profile to Markdown.
|
|
314
|
-
*
|
|
315
|
-
* It is assumed that {@link data} is a valid profile. The behavior of this
|
|
316
|
-
* function is undefined for invalid profiles.
|
|
317
|
-
*
|
|
318
|
-
* See the [V8 heap profile docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/v8-heap-profile.md)
|
|
319
|
-
* for supported runtimes and generation instructions
|
|
320
|
-
* (`profiler-md --help v8-heap-profile`).
|
|
275
|
+
* leaves only your code and the public API surface of `stdlib` and
|
|
276
|
+
* `third-party` code.
|
|
321
277
|
*/
|
|
322
|
-
declare const
|
|
323
|
-
/**
|
|
324
|
-
* Asynchronously converts the given V8 sampling heap profile to Markdown.
|
|
325
|
-
*
|
|
326
|
-
* It is assumed that {@link data} is a valid profile. The behavior of this
|
|
327
|
-
* function is undefined for invalid profiles.
|
|
328
|
-
*
|
|
329
|
-
* See the [V8 heap profile docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/v8-heap-profile.md)
|
|
330
|
-
* for supported runtimes and generation instructions
|
|
331
|
-
* (`profiler-md --help v8-heap-profile`).
|
|
332
|
-
*/
|
|
333
|
-
declare const v8HeapProfileToMdAsync: (data: AsyncProfileData, options?: ProfileToMdOptions) => Promise<string>;
|
|
278
|
+
declare const isExternalImplementationDetailEntry: (entry: DeepReadonly<AggregatedProfileEntry>) => boolean;
|
|
334
279
|
//#endregion
|
|
335
|
-
//#region src/formats/
|
|
280
|
+
//#region src/formats/index.d.ts
|
|
336
281
|
/**
|
|
337
|
-
* Converts the given
|
|
282
|
+
* Converts the given profile data to Markdown.
|
|
338
283
|
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* See the [V8 heap snapshot docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats/v8-heap-snapshot.md)
|
|
343
|
-
* for supported runtimes and generation instructions
|
|
344
|
-
* (`profiler-md --help v8-heap-snapshot`).
|
|
284
|
+
* See the [docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats)
|
|
285
|
+
* for supported formats and generation instructions.
|
|
345
286
|
*/
|
|
346
|
-
declare const
|
|
287
|
+
declare const profileToMd: (input: ProfileInput<ProfileData>, options?: ProfileToMdOptions) => string;
|
|
347
288
|
/**
|
|
348
|
-
* Asynchronously converts the given
|
|
349
|
-
*
|
|
350
|
-
* It is assumed that {@link data} is a valid snapshot. The behavior of this
|
|
351
|
-
* function is undefined for invalid snapshots.
|
|
289
|
+
* Asynchronously converts the given profile data to Markdown.
|
|
352
290
|
*
|
|
353
|
-
* See the [
|
|
354
|
-
* for supported
|
|
355
|
-
* (`profiler-md --help v8-heap-snapshot`).
|
|
291
|
+
* See the [docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats)
|
|
292
|
+
* for supported formats and generation instructions.
|
|
356
293
|
*/
|
|
357
|
-
declare const
|
|
358
|
-
//#endregion
|
|
359
|
-
//#region src/formats/webkit-timeline-recording/index.d.ts
|
|
294
|
+
declare const profileToMdAsync: (input: ProfileInput<AsyncProfileData>, options?: ProfileToMdOptions) => Promise<string>;
|
|
360
295
|
/**
|
|
361
|
-
*
|
|
296
|
+
* Diffs the given base and current profile data, returning the difference as
|
|
297
|
+
* Markdown.
|
|
362
298
|
*
|
|
363
|
-
*
|
|
364
|
-
* function is undefined for invalid recordings.
|
|
299
|
+
* Each side accepts the same input as {@link profileToMd}.
|
|
365
300
|
*
|
|
366
|
-
* See the [
|
|
367
|
-
* for
|
|
301
|
+
* See the [docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats)
|
|
302
|
+
* for supported formats and generation instructions.
|
|
368
303
|
*/
|
|
369
|
-
declare const
|
|
304
|
+
declare const diffProfiles: (base: ProfileInput<ProfileData>, current: ProfileInput<ProfileData>, options?: ProfileToMdOptions) => string;
|
|
370
305
|
/**
|
|
371
|
-
* Asynchronously
|
|
306
|
+
* Asynchronously diffs the given base and current profile data, returning the
|
|
307
|
+
* difference as Markdown.
|
|
372
308
|
*
|
|
373
|
-
*
|
|
374
|
-
* function is undefined for invalid recordings.
|
|
309
|
+
* Each side accepts the same input as {@link profileToMdAsync}.
|
|
375
310
|
*
|
|
376
|
-
* See the [
|
|
377
|
-
* for
|
|
311
|
+
* See the [docs](https://github.com/TomerAberbach/profiler-md/blob/main/docs/formats)
|
|
312
|
+
* for supported formats and generation instructions.
|
|
378
313
|
*/
|
|
379
|
-
declare const
|
|
314
|
+
declare const diffProfilesAsync: (base: ProfileInput<AsyncProfileData>, current: ProfileInput<AsyncProfileData>, options?: ProfileToMdOptions) => Promise<string>;
|
|
315
|
+
declare const formats: readonly ["collapsed", "jsc-heap-snapshot", "pprof", "speedscope", "v8-cpu-profile", "v8-heap-profile", "v8-heap-snapshot", "webkit-timeline-recording"];
|
|
316
|
+
/** Supported profile format IDs. */
|
|
317
|
+
type Format = (typeof formats)[number];
|
|
380
318
|
//#endregion
|
|
381
|
-
export { type AggregatedProfileEntry, type AsyncProfileData, type
|
|
319
|
+
export { type AggregatedProfileEntry, type AsyncProfileData, type EntryOrigin, type FileReference, type Format, type NormalizedEntry, type ProfileData, type ProfileEntry, type ProfileInput, type ProfileToMdOptions, type SourceLocation, type SourceMap, defaultCategorizeEntry, defaultMatchEntry, defaultShowEntry, diffProfiles, diffProfilesAsync, fileReferenceId, isExternalImplementationDetailEntry, isSyntheticEntry, profileToMd, profileToMdAsync };
|