profiler-md 0.7.0 → 0.8.1
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 +1130 -700
- package/dist/index.d.mts +69 -27
- package/dist/index.js +2 -2
- package/docs/languages/javascript.md +13 -1
- package/docs/languages/php.md +12 -0
- package/package.json +1 -1
- package/readme.md +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -368,13 +368,13 @@ type HeapSnapshot = {
|
|
|
368
368
|
* flags. Where an engine's name is its own, the category takes the name every
|
|
369
369
|
* language shares: `internal` covers V8's `hidden` and JavaScriptCore's
|
|
370
370
|
* `internal`, `function` covers V8's `closure` whether or not the function
|
|
371
|
-
* captures anything, and `big
|
|
371
|
+
* captures anything, and `big-number` covers V8's `bigint` along with any
|
|
372
372
|
* arbitrary-precision number a runtime allocates on the heap, such as Julia's
|
|
373
373
|
* `BigFloat`.
|
|
374
374
|
*/
|
|
375
375
|
type HeapSnapshotNodeCategory = (typeof HEAP_SNAPSHOT_NODE_CATEGORIES)[number];
|
|
376
376
|
/** Every category {@link HeapSnapshotNodeCategory} allows. */
|
|
377
|
-
declare const HEAP_SNAPSHOT_NODE_CATEGORIES: readonly ["object", "array", "string", "concatenated
|
|
377
|
+
declare const HEAP_SNAPSHOT_NODE_CATEGORIES: readonly ["object", "array", "string", "concatenated-string", "sliced-string", "function", "code", "regexp", "number", "big-number", "symbol", "native", "object-shape", "internal", "synthetic", "unknown"];
|
|
378
378
|
/**
|
|
379
379
|
* What a heap snapshot node holds, as the format categorized it, before the
|
|
380
380
|
* origin resolves it.
|
|
@@ -435,7 +435,7 @@ declare const formatConverters: {
|
|
|
435
435
|
readonly collapsed: {
|
|
436
436
|
readonly title: "Collapsed stacks";
|
|
437
437
|
readonly extension: "collapsed";
|
|
438
|
-
readonly languages: readonly ["elixir", "java", "python", "ruby"];
|
|
438
|
+
readonly languages: readonly ["elixir", "java", "php", "python", "ruby"];
|
|
439
439
|
readonly fallbackOrigin: "unknown";
|
|
440
440
|
readonly type: "binary";
|
|
441
441
|
readonly matches: (bytes: Uint8Array) => boolean;
|
|
@@ -633,7 +633,7 @@ declare const originSpecs: ({
|
|
|
633
633
|
readonly line?: number | undefined;
|
|
634
634
|
readonly column?: number | undefined;
|
|
635
635
|
} | undefined;
|
|
636
|
-
}) => "
|
|
636
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
637
637
|
} | {
|
|
638
638
|
readonly id: "bun";
|
|
639
639
|
readonly title: "Bun";
|
|
@@ -677,8 +677,8 @@ declare const originSpecs: ({
|
|
|
677
677
|
readonly line?: number | undefined;
|
|
678
678
|
readonly column?: number | undefined;
|
|
679
679
|
} | undefined;
|
|
680
|
-
}) => "
|
|
681
|
-
readonly categorizeHeapSnapshotConstructor: (name: string) => "string" | "number" | "symbol" | "object" | "function" | "
|
|
680
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
681
|
+
readonly categorizeHeapSnapshotConstructor: (name: string) => "string" | "number" | "symbol" | "object" | "function" | "native" | "unknown" | "regexp" | "array" | "concatenated-string" | "sliced-string" | "code" | "big-number" | "object-shape" | "internal" | "synthetic" | undefined;
|
|
682
682
|
} | {
|
|
683
683
|
readonly id: "node";
|
|
684
684
|
readonly title: "Node.js";
|
|
@@ -722,7 +722,7 @@ declare const originSpecs: ({
|
|
|
722
722
|
readonly line?: number | undefined;
|
|
723
723
|
readonly column?: number | undefined;
|
|
724
724
|
} | undefined;
|
|
725
|
-
}) => "
|
|
725
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
726
726
|
readonly categorizeHeapSnapshotConstructor: (name: string) => HeapSnapshotNodeCategory | undefined;
|
|
727
727
|
} | {
|
|
728
728
|
readonly id: "chrome";
|
|
@@ -767,7 +767,7 @@ declare const originSpecs: ({
|
|
|
767
767
|
readonly line?: number | undefined;
|
|
768
768
|
readonly column?: number | undefined;
|
|
769
769
|
} | undefined;
|
|
770
|
-
}) => "
|
|
770
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
771
771
|
readonly categorizeHeapSnapshotConstructor: (name: string) => HeapSnapshotNodeCategory | undefined;
|
|
772
772
|
} | {
|
|
773
773
|
readonly id: "node-pprof";
|
|
@@ -811,7 +811,7 @@ declare const originSpecs: ({
|
|
|
811
811
|
readonly line?: number | undefined;
|
|
812
812
|
readonly column?: number | undefined;
|
|
813
813
|
} | undefined;
|
|
814
|
-
}) => "
|
|
814
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
815
815
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame;
|
|
816
816
|
} | {
|
|
817
817
|
readonly id: "pprof-rs";
|
|
@@ -855,7 +855,7 @@ declare const originSpecs: ({
|
|
|
855
855
|
readonly line?: number | undefined;
|
|
856
856
|
readonly column?: number | undefined;
|
|
857
857
|
} | undefined;
|
|
858
|
-
}) => "
|
|
858
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
859
859
|
readonly matchEntry: (entry: DeepReadonly<ProfileEntry>) => EntryMatch | undefined;
|
|
860
860
|
} | {
|
|
861
861
|
readonly id: "go";
|
|
@@ -900,7 +900,7 @@ declare const originSpecs: ({
|
|
|
900
900
|
readonly line?: number | undefined;
|
|
901
901
|
readonly column?: number | undefined;
|
|
902
902
|
} | undefined;
|
|
903
|
-
}) => "
|
|
903
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
904
904
|
} | {
|
|
905
905
|
readonly id: "pprof-jl";
|
|
906
906
|
readonly formats: ["pprof"];
|
|
@@ -943,7 +943,7 @@ declare const originSpecs: ({
|
|
|
943
943
|
readonly line?: number | undefined;
|
|
944
944
|
readonly column?: number | undefined;
|
|
945
945
|
} | undefined;
|
|
946
|
-
}) => "
|
|
946
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
947
947
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame | null;
|
|
948
948
|
} | {
|
|
949
949
|
readonly id: "profile-jl";
|
|
@@ -1013,7 +1013,7 @@ declare const originSpecs: ({
|
|
|
1013
1013
|
readonly line?: number | undefined;
|
|
1014
1014
|
readonly column?: number | undefined;
|
|
1015
1015
|
} | undefined;
|
|
1016
|
-
}) => "
|
|
1016
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1017
1017
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame | {
|
|
1018
1018
|
location: {
|
|
1019
1019
|
type: `file`;
|
|
@@ -1149,7 +1149,7 @@ declare const originSpecs: ({
|
|
|
1149
1149
|
readonly line?: number | undefined;
|
|
1150
1150
|
readonly column?: number | undefined;
|
|
1151
1151
|
} | undefined;
|
|
1152
|
-
}) => "
|
|
1152
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1153
1153
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame | null;
|
|
1154
1154
|
} | {
|
|
1155
1155
|
readonly id: "eflambe";
|
|
@@ -1194,7 +1194,7 @@ declare const originSpecs: ({
|
|
|
1194
1194
|
readonly line?: number | undefined;
|
|
1195
1195
|
readonly column?: number | undefined;
|
|
1196
1196
|
} | undefined;
|
|
1197
|
-
}) => "
|
|
1197
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1198
1198
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame;
|
|
1199
1199
|
} | {
|
|
1200
1200
|
readonly id: "valgrind";
|
|
@@ -1264,7 +1264,7 @@ declare const originSpecs: ({
|
|
|
1264
1264
|
readonly line?: number | undefined;
|
|
1265
1265
|
readonly column?: number | undefined;
|
|
1266
1266
|
} | undefined;
|
|
1267
|
-
}) => "
|
|
1267
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1268
1268
|
readonly normalizeStackFrame: (input: StackFrame, format: "callgrind" | "collapsed" | "hprof" | "jfr" | "memray" | "perf" | "pprof" | "systing" | "ghc-eventlog" | "ghc-json-profile" | "jsc-heap-snapshot" | "speedscope" | "v8-cpu-profile" | "v8-heap-profile" | "v8-heap-snapshot" | "webkit-timeline-recording") => StackFrame;
|
|
1269
1269
|
} | {
|
|
1270
1270
|
readonly id: "safari";
|
|
@@ -1290,8 +1290,8 @@ declare const originSpecs: ({
|
|
|
1290
1290
|
readonly line?: number | undefined;
|
|
1291
1291
|
readonly column?: number | undefined;
|
|
1292
1292
|
} | undefined;
|
|
1293
|
-
}) => "
|
|
1294
|
-
readonly categorizeHeapSnapshotConstructor: (name: string) => "string" | "number" | "symbol" | "object" | "function" | "
|
|
1293
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1294
|
+
readonly categorizeHeapSnapshotConstructor: (name: string) => "string" | "number" | "symbol" | "object" | "function" | "native" | "unknown" | "regexp" | "array" | "concatenated-string" | "sliced-string" | "code" | "big-number" | "object-shape" | "internal" | "synthetic" | undefined;
|
|
1295
1295
|
} | {
|
|
1296
1296
|
readonly id: "systing";
|
|
1297
1297
|
readonly formats: ["systing"];
|
|
@@ -1334,7 +1334,7 @@ declare const originSpecs: ({
|
|
|
1334
1334
|
readonly line?: number | undefined;
|
|
1335
1335
|
readonly column?: number | undefined;
|
|
1336
1336
|
} | undefined;
|
|
1337
|
-
}) => "
|
|
1337
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1338
1338
|
readonly normalizeStackFrame: (input: StackFrame) => StackFrame;
|
|
1339
1339
|
} | {
|
|
1340
1340
|
readonly id: "gperftools";
|
|
@@ -1359,13 +1359,52 @@ declare const originSpecs: ({
|
|
|
1359
1359
|
readonly line?: number | undefined;
|
|
1360
1360
|
readonly column?: number | undefined;
|
|
1361
1361
|
} | undefined;
|
|
1362
|
-
}) => "
|
|
1362
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1363
1363
|
} | {
|
|
1364
1364
|
readonly id: "excimer";
|
|
1365
1365
|
readonly title: "Excimer";
|
|
1366
|
-
readonly formats: ["speedscope"];
|
|
1367
|
-
readonly isMarkerEntry: (
|
|
1368
|
-
|
|
1366
|
+
readonly formats: ["collapsed", "speedscope"];
|
|
1367
|
+
readonly isMarkerEntry: ({ name }: {
|
|
1368
|
+
readonly id: number;
|
|
1369
|
+
readonly name?: string | undefined;
|
|
1370
|
+
readonly location?: {
|
|
1371
|
+
readonly type: `absolute`;
|
|
1372
|
+
readonly url: URL;
|
|
1373
|
+
readonly line?: number | undefined;
|
|
1374
|
+
readonly column?: number | undefined;
|
|
1375
|
+
} | {
|
|
1376
|
+
readonly type: `relative`;
|
|
1377
|
+
readonly path: string;
|
|
1378
|
+
readonly line?: number | undefined;
|
|
1379
|
+
readonly column?: number | undefined;
|
|
1380
|
+
} | {
|
|
1381
|
+
readonly type: `logical`;
|
|
1382
|
+
readonly name: string;
|
|
1383
|
+
readonly line?: number | undefined;
|
|
1384
|
+
readonly column?: number | undefined;
|
|
1385
|
+
} | undefined;
|
|
1386
|
+
}) => boolean;
|
|
1387
|
+
readonly categorizeEntry: (entry: {
|
|
1388
|
+
readonly id: number;
|
|
1389
|
+
readonly name?: string | undefined;
|
|
1390
|
+
readonly location?: {
|
|
1391
|
+
readonly type: `absolute`;
|
|
1392
|
+
readonly url: URL;
|
|
1393
|
+
readonly line?: number | undefined;
|
|
1394
|
+
readonly column?: number | undefined;
|
|
1395
|
+
} | {
|
|
1396
|
+
readonly type: `relative`;
|
|
1397
|
+
readonly path: string;
|
|
1398
|
+
readonly line?: number | undefined;
|
|
1399
|
+
readonly column?: number | undefined;
|
|
1400
|
+
} | {
|
|
1401
|
+
readonly type: `logical`;
|
|
1402
|
+
readonly name: string;
|
|
1403
|
+
readonly line?: number | undefined;
|
|
1404
|
+
readonly column?: number | undefined;
|
|
1405
|
+
} | undefined;
|
|
1406
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1407
|
+
readonly normalizeStackFrame: (input: StackFrame) => StackFrame;
|
|
1369
1408
|
} | {
|
|
1370
1409
|
readonly id: "memray";
|
|
1371
1410
|
readonly formats: ["memray"];
|
|
@@ -1395,7 +1434,7 @@ declare const originSpecs: ({
|
|
|
1395
1434
|
readonly line?: number | undefined;
|
|
1396
1435
|
readonly column?: number | undefined;
|
|
1397
1436
|
} | undefined;
|
|
1398
|
-
}) => "
|
|
1437
|
+
}) => "ours" | "third-party" | "stdlib" | "native" | "unknown" | "garbage-collector" | "compiler" | "jit" | "regexp" | "kernel" | "idle";
|
|
1399
1438
|
} | {
|
|
1400
1439
|
readonly id: "simpleperf";
|
|
1401
1440
|
readonly formats: ["perf"];
|
|
@@ -1664,11 +1703,11 @@ type ProfileInput<Data> = Data | {
|
|
|
1664
1703
|
* executing code the runtime generated. Where a frame both executes generated
|
|
1665
1704
|
* code and does the work of a named activity, the activity takes precedence,
|
|
1666
1705
|
* so a garbage collection write barrier compiled inline is
|
|
1667
|
-
* `garbage
|
|
1706
|
+
* `garbage-collector`
|
|
1668
1707
|
*/
|
|
1669
1708
|
type FunctionCategory = (typeof FUNCTION_CATEGORIES)[number];
|
|
1670
1709
|
/** Every category {@link FunctionCategory} allows. */
|
|
1671
|
-
declare const FUNCTION_CATEGORIES: readonly ["ours", "third-party", "stdlib", "native", "unknown", "garbage
|
|
1710
|
+
declare const FUNCTION_CATEGORIES: readonly ["ours", "third-party", "stdlib", "native", "unknown", "garbage-collector", "compiler", "jit", "regexp", "kernel", "idle"];
|
|
1672
1711
|
/** A single entry in a formatted profile. */
|
|
1673
1712
|
type ProfileEntry = {
|
|
1674
1713
|
/** An index that uniquely identifies this entry. */
|
|
@@ -1930,7 +1969,10 @@ declare const diffProfilesAsync: (base: ProfileInput<AsyncProfileData>, current:
|
|
|
1930
1969
|
* format, a malformed profile, an invalid option.
|
|
1931
1970
|
*
|
|
1932
1971
|
* A failure the caller cannot fix throws a plain `Error` instead, because such
|
|
1933
|
-
* a failure is a bug in this package.
|
|
1972
|
+
* a failure is a bug in this package. The exception is a parser failing on an
|
|
1973
|
+
* error it did not classify, which is either an input violating the format in
|
|
1974
|
+
* a way the parser does not check or a parser bug. That failure throws a
|
|
1975
|
+
* `ProfilerMdError` too, and `mayBeParserBug` identifies it.
|
|
1934
1976
|
*/
|
|
1935
1977
|
declare class ProfilerMdError extends Error {
|
|
1936
1978
|
constructor(message: string, options?: ErrorOptions);
|