@datadog/pprof 5.0.0-pre-39c03d4 → 5.0.0-pre-d624748
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/out/src/heap-profiler-bindings.d.ts +1 -1
- package/out/src/heap-profiler-bindings.js +2 -2
- package/out/src/heap-profiler-bindings.js.map +1 -1
- package/out/src/heap-profiler.d.ts +3 -3
- package/out/src/heap-profiler.js +6 -5
- package/out/src/heap-profiler.js.map +1 -1
- package/out/src/index.d.ts +3 -0
- package/out/src/index.js +4 -1
- package/out/src/index.js.map +1 -1
- package/out/src/profile-serializer.d.ts +4 -3
- package/out/src/profile-serializer.js +62 -7
- package/out/src/profile-serializer.js.map +1 -1
- package/out/src/time-profiler-bindings.d.ts +1 -0
- package/out/src/time-profiler-bindings.js +2 -1
- package/out/src/time-profiler-bindings.js.map +1 -1
- package/out/src/time-profiler.d.ts +9 -5
- package/out/src/time-profiler.js +32 -16
- package/out/src/time-profiler.js.map +1 -1
- package/out/src/v8-types.d.ts +16 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node-102.node +0 -0
- package/prebuilds/darwin-arm64/node-108.node +0 -0
- package/prebuilds/darwin-arm64/node-111.node +0 -0
- package/prebuilds/darwin-arm64/node-115.node +0 -0
- package/prebuilds/darwin-arm64/node-120.node +0 -0
- package/prebuilds/darwin-arm64/node-83.node +0 -0
- package/prebuilds/darwin-arm64/node-88.node +0 -0
- package/prebuilds/darwin-arm64/node-93.node +0 -0
- package/prebuilds/darwin-x64/node-102.node +0 -0
- package/prebuilds/darwin-x64/node-108.node +0 -0
- package/prebuilds/darwin-x64/node-111.node +0 -0
- package/prebuilds/darwin-x64/node-115.node +0 -0
- package/prebuilds/darwin-x64/node-120.node +0 -0
- package/prebuilds/darwin-x64/node-83.node +0 -0
- package/prebuilds/darwin-x64/node-88.node +0 -0
- package/prebuilds/darwin-x64/node-93.node +0 -0
- package/prebuilds/linux-arm/node-102.node +0 -0
- package/prebuilds/linux-arm/node-108.node +0 -0
- package/prebuilds/linux-arm/node-111.node +0 -0
- package/prebuilds/linux-arm/node-115.node +0 -0
- package/prebuilds/linux-arm/node-120.node +0 -0
- package/prebuilds/linux-arm/node-83.node +0 -0
- package/prebuilds/linux-arm/node-88.node +0 -0
- package/prebuilds/linux-arm/node-93.node +0 -0
- package/prebuilds/linux-arm64/node-102.node +0 -0
- package/prebuilds/linux-arm64/node-108.node +0 -0
- package/prebuilds/linux-arm64/node-111.node +0 -0
- package/prebuilds/linux-arm64/node-115.node +0 -0
- package/prebuilds/linux-arm64/node-120.node +0 -0
- package/prebuilds/linux-arm64/node-83.node +0 -0
- package/prebuilds/linux-arm64/node-88.node +0 -0
- package/prebuilds/linux-arm64/node-93.node +0 -0
- package/prebuilds/linux-x64/node-102.node +0 -0
- package/prebuilds/linux-x64/node-108.node +0 -0
- package/prebuilds/linux-x64/node-111.node +0 -0
- package/prebuilds/linux-x64/node-115.node +0 -0
- package/prebuilds/linux-x64/node-120.node +0 -0
- package/prebuilds/linux-x64/node-83.node +0 -0
- package/prebuilds/linux-x64/node-88.node +0 -0
- package/prebuilds/linux-x64/node-93.node +0 -0
- package/prebuilds/linuxmusl-x64/node-102.node +0 -0
- package/prebuilds/linuxmusl-x64/node-108.node +0 -0
- package/prebuilds/linuxmusl-x64/node-111.node +0 -0
- package/prebuilds/linuxmusl-x64/node-115.node +0 -0
- package/prebuilds/linuxmusl-x64/node-120.node +0 -0
- package/prebuilds/linuxmusl-x64/node-83.node +0 -0
- package/prebuilds/linuxmusl-x64/node-88.node +0 -0
- package/prebuilds/linuxmusl-x64/node-93.node +0 -0
- package/prebuilds/win32-ia32/node-102.node +0 -0
- package/prebuilds/win32-ia32/node-83.node +0 -0
- package/prebuilds/win32-ia32/node-88.node +0 -0
- package/prebuilds/win32-ia32/node-93.node +0 -0
- package/prebuilds/win32-x64/node-102.node +0 -0
- package/prebuilds/win32-x64/node-108.node +0 -0
- package/prebuilds/win32-x64/node-111.node +0 -0
- package/prebuilds/win32-x64/node-115.node +0 -0
- package/prebuilds/win32-x64/node-120.node +0 -0
- package/prebuilds/win32-x64/node-83.node +0 -0
- package/prebuilds/win32-x64/node-88.node +0 -0
- package/prebuilds/win32-x64/node-93.node +0 -0
|
@@ -18,4 +18,4 @@ export declare function startSamplingHeapProfiler(heapIntervalBytes: number, hea
|
|
|
18
18
|
export declare function stopSamplingHeapProfiler(): void;
|
|
19
19
|
export declare function getAllocationProfile(): AllocationProfileNode;
|
|
20
20
|
export type NearHeapLimitCallback = (profile: AllocationProfileNode) => void;
|
|
21
|
-
export declare function monitorOutOfMemory(heapLimitExtensionSize: number, maxHeapLimitExtensionCount: number, dumpHeapProfileOnSdterr: boolean, exportCommand: Array<String> | undefined, callback: NearHeapLimitCallback | undefined, callbackMode: number): void;
|
|
21
|
+
export declare function monitorOutOfMemory(heapLimitExtensionSize: number, maxHeapLimitExtensionCount: number, dumpHeapProfileOnSdterr: boolean, exportCommand: Array<String> | undefined, callback: NearHeapLimitCallback | undefined, callbackMode: number, isMainThread: boolean): void;
|
|
@@ -55,8 +55,8 @@ function getAllocationProfile() {
|
|
|
55
55
|
return profiler.heapProfiler.getAllocationProfile();
|
|
56
56
|
}
|
|
57
57
|
exports.getAllocationProfile = getAllocationProfile;
|
|
58
|
-
function monitorOutOfMemory(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand, callback, callbackMode) {
|
|
59
|
-
profiler.heapProfiler.monitorOutOfMemory(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand, callback, callbackMode);
|
|
58
|
+
function monitorOutOfMemory(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand, callback, callbackMode, isMainThread) {
|
|
59
|
+
profiler.heapProfiler.monitorOutOfMemory(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand, callback, callbackMode, isMainThread);
|
|
60
60
|
}
|
|
61
61
|
exports.monitorOutOfMemory = monitorOutOfMemory;
|
|
62
62
|
//# sourceMappingURL=heap-profiler-bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heap-profiler-bindings.js","sourceRoot":"","sources":["../../ts/src/heap-profiler-bindings.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAI7B,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE/D,kDAAkD;AAElD,SAAgB,yBAAyB,CACvC,iBAAyB,EACzB,cAAsB;IAEtB,QAAQ,CAAC,YAAY,CAAC,yBAAyB,CAC7C,iBAAiB,EACjB,cAAc,CACf,CAAC;AACJ,CAAC;AARD,8DAQC;AAED,SAAgB,wBAAwB;IACtC,QAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACnD,CAAC;AAFD,4DAEC;AAED,SAAgB,oBAAoB;IAClC,OAAO,QAAQ,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC;AACtD,CAAC;AAFD,oDAEC;AAID,SAAgB,kBAAkB,CAChC,sBAA8B,EAC9B,0BAAkC,EAClC,uBAAgC,EAChC,aAAwC,EACxC,QAA2C,EAC3C,YAAoB;
|
|
1
|
+
{"version":3,"file":"heap-profiler-bindings.js","sourceRoot":"","sources":["../../ts/src/heap-profiler-bindings.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAI7B,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE/D,kDAAkD;AAElD,SAAgB,yBAAyB,CACvC,iBAAyB,EACzB,cAAsB;IAEtB,QAAQ,CAAC,YAAY,CAAC,yBAAyB,CAC7C,iBAAiB,EACjB,cAAc,CACf,CAAC;AACJ,CAAC;AARD,8DAQC;AAED,SAAgB,wBAAwB;IACtC,QAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACnD,CAAC;AAFD,4DAEC;AAED,SAAgB,oBAAoB;IAClC,OAAO,QAAQ,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC;AACtD,CAAC;AAFD,oDAEC;AAID,SAAgB,kBAAkB,CAChC,sBAA8B,EAC9B,0BAAkC,EAClC,uBAAgC,EAChC,aAAwC,EACxC,QAA2C,EAC3C,YAAoB,EACpB,YAAqB;IAErB,QAAQ,CAAC,YAAY,CAAC,kBAAkB,CACtC,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,CACb,CAAC;AACJ,CAAC;AAlBD,gDAkBC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Profile } from 'pprof-format';
|
|
17
17
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
18
|
-
import { AllocationProfileNode } from './v8-types';
|
|
18
|
+
import { AllocationProfileNode, GenerateAllocationLabelsFunction } from './v8-types';
|
|
19
19
|
export declare function v8Profile(): AllocationProfileNode;
|
|
20
20
|
/**
|
|
21
21
|
* Collects a profile and returns it serialized in pprof format.
|
|
@@ -24,8 +24,8 @@ export declare function v8Profile(): AllocationProfileNode;
|
|
|
24
24
|
* @param ignoreSamplePath
|
|
25
25
|
* @param sourceMapper
|
|
26
26
|
*/
|
|
27
|
-
export declare function profile(ignoreSamplePath?: string, sourceMapper?: SourceMapper): Profile;
|
|
28
|
-
export declare function convertProfile(rootNode: AllocationProfileNode, ignoreSamplePath?: string, sourceMapper?: SourceMapper): Profile;
|
|
27
|
+
export declare function profile(ignoreSamplePath?: string, sourceMapper?: SourceMapper, generateLabels?: GenerateAllocationLabelsFunction): Profile;
|
|
28
|
+
export declare function convertProfile(rootNode: AllocationProfileNode, ignoreSamplePath?: string, sourceMapper?: SourceMapper, generateLabels?: GenerateAllocationLabelsFunction): Profile;
|
|
29
29
|
/**
|
|
30
30
|
* Starts heap profiling. If heap profiling has already been started with
|
|
31
31
|
* the same parameters, this is a noop. If heap profiler has already been
|
package/out/src/heap-profiler.js
CHANGED
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.monitorOutOfMemory = exports.CallbackMode = exports.stop = exports.start = exports.convertProfile = exports.profile = exports.v8Profile = void 0;
|
|
19
19
|
const heap_profiler_bindings_1 = require("./heap-profiler-bindings");
|
|
20
20
|
const profile_serializer_1 = require("./profile-serializer");
|
|
21
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
21
22
|
let enabled = false;
|
|
22
23
|
let heapIntervalBytes = 0;
|
|
23
24
|
let heapStackDepth = 0;
|
|
@@ -41,11 +42,11 @@ exports.v8Profile = v8Profile;
|
|
|
41
42
|
* @param ignoreSamplePath
|
|
42
43
|
* @param sourceMapper
|
|
43
44
|
*/
|
|
44
|
-
function profile(ignoreSamplePath, sourceMapper) {
|
|
45
|
-
return convertProfile(v8Profile(), ignoreSamplePath, sourceMapper);
|
|
45
|
+
function profile(ignoreSamplePath, sourceMapper, generateLabels) {
|
|
46
|
+
return convertProfile(v8Profile(), ignoreSamplePath, sourceMapper, generateLabels);
|
|
46
47
|
}
|
|
47
48
|
exports.profile = profile;
|
|
48
|
-
function convertProfile(rootNode, ignoreSamplePath, sourceMapper) {
|
|
49
|
+
function convertProfile(rootNode, ignoreSamplePath, sourceMapper, generateLabels) {
|
|
49
50
|
const startTimeNanos = Date.now() * 1000 * 1000;
|
|
50
51
|
// Add node for external memory usage.
|
|
51
52
|
// Current type definitions do not have external.
|
|
@@ -61,7 +62,7 @@ function convertProfile(rootNode, ignoreSamplePath, sourceMapper) {
|
|
|
61
62
|
};
|
|
62
63
|
rootNode.children.push(externalNode);
|
|
63
64
|
}
|
|
64
|
-
return (0, profile_serializer_1.serializeHeapProfile)(rootNode, startTimeNanos, heapIntervalBytes, ignoreSamplePath, sourceMapper);
|
|
65
|
+
return (0, profile_serializer_1.serializeHeapProfile)(rootNode, startTimeNanos, heapIntervalBytes, ignoreSamplePath, sourceMapper, generateLabels);
|
|
65
66
|
}
|
|
66
67
|
exports.convertProfile = convertProfile;
|
|
67
68
|
/**
|
|
@@ -132,7 +133,7 @@ function monitorOutOfMemory(heapLimitExtensionSize, maxHeapLimitExtensionCount,
|
|
|
132
133
|
callback(convertProfile(profile));
|
|
133
134
|
};
|
|
134
135
|
}
|
|
135
|
-
(0, heap_profiler_bindings_1.monitorOutOfMemory)(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand || [], newCallback, typeof callbackMode !== 'undefined' ? callbackMode : exports.CallbackMode.Async);
|
|
136
|
+
(0, heap_profiler_bindings_1.monitorOutOfMemory)(heapLimitExtensionSize, maxHeapLimitExtensionCount, dumpHeapProfileOnSdterr, exportCommand || [], newCallback, typeof callbackMode !== 'undefined' ? callbackMode : exports.CallbackMode.Async, node_worker_threads_1.isMainThread);
|
|
136
137
|
}
|
|
137
138
|
exports.monitorOutOfMemory = monitorOutOfMemory;
|
|
138
139
|
//# sourceMappingURL=heap-profiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heap-profiler.js","sourceRoot":"","sources":["../../ts/src/heap-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,qEAKkC;AAClC,6DAA0D;
|
|
1
|
+
{"version":3,"file":"heap-profiler.js","sourceRoot":"","sources":["../../ts/src/heap-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,qEAK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,kCAAY,CACb,CAAC;AACJ,CAAC;AA5BD,gDA4BC"}
|
package/out/src/index.d.ts
CHANGED
|
@@ -4,16 +4,19 @@ export { AllocationProfileNode, TimeProfileNode, ProfileNode, LabelSet, } from '
|
|
|
4
4
|
export { encode, encodeSync } from './profile-encoder';
|
|
5
5
|
export { SourceMapper } from './sourcemapper/sourcemapper';
|
|
6
6
|
export { setLogger } from './logger';
|
|
7
|
+
export { getNativeThreadId } from './time-profiler';
|
|
7
8
|
export declare const time: {
|
|
8
9
|
profile: typeof timeProfiler.profile;
|
|
9
10
|
start: typeof timeProfiler.start;
|
|
10
11
|
stop: typeof timeProfiler.stop;
|
|
12
|
+
getContext: typeof timeProfiler.getContext;
|
|
11
13
|
setContext: typeof timeProfiler.setContext;
|
|
12
14
|
isStarted: typeof timeProfiler.isStarted;
|
|
13
15
|
v8ProfilerStuckEventLoopDetected: typeof timeProfiler.v8ProfilerStuckEventLoopDetected;
|
|
14
16
|
getState: typeof timeProfiler.getState;
|
|
15
17
|
constants: {
|
|
16
18
|
kSampleCount: any;
|
|
19
|
+
NON_JS_THREADS_FUNCTION_NAME: string;
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
22
|
export declare const heap: {
|
package/out/src/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.heap = exports.time = exports.setLogger = exports.SourceMapper = exports.encodeSync = exports.encode = void 0;
|
|
26
|
+
exports.heap = exports.time = exports.getNativeThreadId = exports.setLogger = exports.SourceMapper = exports.encodeSync = exports.encode = void 0;
|
|
27
27
|
/**
|
|
28
28
|
* Copyright 2019 Google Inc. All Rights Reserved.
|
|
29
29
|
*
|
|
@@ -50,10 +50,13 @@ var sourcemapper_1 = require("./sourcemapper/sourcemapper");
|
|
|
50
50
|
Object.defineProperty(exports, "SourceMapper", { enumerable: true, get: function () { return sourcemapper_1.SourceMapper; } });
|
|
51
51
|
var logger_1 = require("./logger");
|
|
52
52
|
Object.defineProperty(exports, "setLogger", { enumerable: true, get: function () { return logger_1.setLogger; } });
|
|
53
|
+
var time_profiler_1 = require("./time-profiler");
|
|
54
|
+
Object.defineProperty(exports, "getNativeThreadId", { enumerable: true, get: function () { return time_profiler_1.getNativeThreadId; } });
|
|
53
55
|
exports.time = {
|
|
54
56
|
profile: timeProfiler.profile,
|
|
55
57
|
start: timeProfiler.start,
|
|
56
58
|
stop: timeProfiler.stop,
|
|
59
|
+
getContext: timeProfiler.getContext,
|
|
57
60
|
setContext: timeProfiler.setContext,
|
|
58
61
|
isStarted: timeProfiler.isStarted,
|
|
59
62
|
v8ProfilerStuckEventLoopDetected: timeProfiler.v8ProfilerStuckEventLoopDetected,
|
package/out/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAAiC;AAEjC,8DAAgD;AAChD,uDAA6C;AAC7C,8DAAgD;AAQhD,qDAAqD;AAA7C,yGAAA,MAAM,OAAA;AAAE,6GAAA,UAAU,OAAA;AAC1B,4DAAyD;AAAjD,4GAAA,YAAY,OAAA;AACpB,mCAAmC;AAA3B,mGAAA,SAAS,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAAiC;AAEjC,8DAAgD;AAChD,uDAA6C;AAC7C,8DAAgD;AAQhD,qDAAqD;AAA7C,yGAAA,MAAM,OAAA;AAAE,6GAAA,UAAU,OAAA;AAC1B,4DAAyD;AAAjD,4GAAA,YAAY,OAAA;AACpB,mCAAmC;AAA3B,mGAAA,SAAS,O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16
16
|
import { Profile } from 'pprof-format';
|
|
17
17
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
18
|
-
import { AllocationProfileNode,
|
|
18
|
+
import { AllocationProfileNode, GenerateAllocationLabelsFunction, GenerateTimeLabelsFunction, TimeProfile } from './v8-types';
|
|
19
|
+
export declare const NON_JS_THREADS_FUNCTION_NAME = "(non-JS threads)";
|
|
19
20
|
/**
|
|
20
21
|
* Converts v8 time profile into into a profile proto.
|
|
21
22
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -23,7 +24,7 @@ import { AllocationProfileNode, LabelSet, TimeProfile, TimeProfileNodeContext }
|
|
|
23
24
|
* @param prof - profile to be converted.
|
|
24
25
|
* @param intervalMicros - average time (microseconds) between samples.
|
|
25
26
|
*/
|
|
26
|
-
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?:
|
|
27
|
+
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?: GenerateTimeLabelsFunction): Profile;
|
|
27
28
|
/**
|
|
28
29
|
* Converts v8 heap profile into into a profile proto.
|
|
29
30
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -34,4 +35,4 @@ export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros:
|
|
|
34
35
|
* nanoseconds.
|
|
35
36
|
* @param intervalBytes - bytes allocated between samples.
|
|
36
37
|
*/
|
|
37
|
-
export declare function serializeHeapProfile(prof: AllocationProfileNode, startTimeNanos: number, intervalBytes: number, ignoreSamplesPath?: string, sourceMapper?: SourceMapper): Profile;
|
|
38
|
+
export declare function serializeHeapProfile(prof: AllocationProfileNode, startTimeNanos: number, intervalBytes: number, ignoreSamplesPath?: string, sourceMapper?: SourceMapper, generateLabels?: GenerateAllocationLabelsFunction): Profile;
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.serializeHeapProfile = exports.serializeTimeProfile = void 0;
|
|
18
|
+
exports.serializeHeapProfile = exports.serializeTimeProfile = exports.NON_JS_THREADS_FUNCTION_NAME = void 0;
|
|
19
19
|
const pprof_format_1 = require("pprof-format");
|
|
20
|
+
exports.NON_JS_THREADS_FUNCTION_NAME = '(non-JS threads)';
|
|
20
21
|
function isGeneratedLocation(location) {
|
|
21
22
|
return (location.column !== undefined &&
|
|
22
23
|
location.line !== undefined &&
|
|
@@ -151,6 +152,16 @@ function createTimeValueType(table) {
|
|
|
151
152
|
unit: table.dedup('nanoseconds'),
|
|
152
153
|
});
|
|
153
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* @return value type for cpu samples (type:cpu, units:nanoseconds), and
|
|
157
|
+
* adds strings used in this value type to the table.
|
|
158
|
+
*/
|
|
159
|
+
function createCpuValueType(table) {
|
|
160
|
+
return new pprof_format_1.ValueType({
|
|
161
|
+
type: table.dedup('cpu'),
|
|
162
|
+
unit: table.dedup('nanoseconds'),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
154
165
|
/**
|
|
155
166
|
* @return value type for object counts (type:objects, units:count), and
|
|
156
167
|
* adds strings used in this value type to the table.
|
|
@@ -198,22 +209,38 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper, recomputeSampl
|
|
|
198
209
|
const intervalNanos = intervalMicros * 1000;
|
|
199
210
|
const appendTimeEntryToSamples = (entry, samples) => {
|
|
200
211
|
let unlabelledHits = entry.node.hitCount;
|
|
212
|
+
let unlabelledCpuTime = 0;
|
|
201
213
|
for (const context of entry.node.contexts || []) {
|
|
202
|
-
const labels = generateLabels
|
|
214
|
+
const labels = generateLabels
|
|
215
|
+
? generateLabels({ node: entry.node, context })
|
|
216
|
+
: context.context;
|
|
203
217
|
if (Object.keys(labels).length > 0) {
|
|
218
|
+
const values = [1, intervalNanos];
|
|
219
|
+
if (prof.hasCpuTime) {
|
|
220
|
+
values.push(context.cpuTime);
|
|
221
|
+
}
|
|
204
222
|
const sample = new pprof_format_1.Sample({
|
|
205
223
|
locationId: entry.stack,
|
|
206
|
-
value:
|
|
224
|
+
value: values,
|
|
207
225
|
label: buildLabels(labels, stringTable),
|
|
208
226
|
});
|
|
209
227
|
samples.push(sample);
|
|
210
228
|
unlabelledHits--;
|
|
211
229
|
}
|
|
230
|
+
else if (prof.hasCpuTime) {
|
|
231
|
+
unlabelledCpuTime += context.cpuTime;
|
|
232
|
+
}
|
|
212
233
|
}
|
|
213
|
-
if (unlabelledHits > 0) {
|
|
234
|
+
if (unlabelledHits > 0 || unlabelledCpuTime > 0) {
|
|
235
|
+
const labels = generateLabels ? generateLabels({ node: entry.node }) : {};
|
|
236
|
+
const values = [unlabelledHits, unlabelledHits * intervalNanos];
|
|
237
|
+
if (prof.hasCpuTime) {
|
|
238
|
+
values.push(unlabelledCpuTime);
|
|
239
|
+
}
|
|
214
240
|
const sample = new pprof_format_1.Sample({
|
|
215
241
|
locationId: entry.stack,
|
|
216
|
-
value:
|
|
242
|
+
value: values,
|
|
243
|
+
label: buildLabels(labels, stringTable),
|
|
217
244
|
});
|
|
218
245
|
samples.push(sample);
|
|
219
246
|
}
|
|
@@ -221,13 +248,37 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper, recomputeSampl
|
|
|
221
248
|
const stringTable = new pprof_format_1.StringTable();
|
|
222
249
|
const sampleValueType = createSampleCountValueType(stringTable);
|
|
223
250
|
const timeValueType = createTimeValueType(stringTable);
|
|
251
|
+
const sampleTypes = [sampleValueType, timeValueType];
|
|
252
|
+
if (prof.hasCpuTime) {
|
|
253
|
+
const cpuValueType = createCpuValueType(stringTable);
|
|
254
|
+
sampleTypes.push(cpuValueType);
|
|
255
|
+
}
|
|
224
256
|
const profile = {
|
|
225
|
-
sampleType:
|
|
257
|
+
sampleType: sampleTypes,
|
|
226
258
|
timeNanos: Date.now() * 1000 * 1000,
|
|
227
259
|
durationNanos: (prof.endTime - prof.startTime) * 1000,
|
|
228
260
|
periodType: timeValueType,
|
|
229
261
|
period: intervalNanos,
|
|
230
262
|
};
|
|
263
|
+
if (prof.nonJSThreadsCpuTime) {
|
|
264
|
+
const node = {
|
|
265
|
+
name: exports.NON_JS_THREADS_FUNCTION_NAME,
|
|
266
|
+
scriptName: '',
|
|
267
|
+
scriptId: 0,
|
|
268
|
+
lineNumber: 0,
|
|
269
|
+
columnNumber: 0,
|
|
270
|
+
children: [],
|
|
271
|
+
hitCount: 0,
|
|
272
|
+
contexts: [
|
|
273
|
+
{
|
|
274
|
+
context: {},
|
|
275
|
+
timestamp: BigInt(0),
|
|
276
|
+
cpuTime: prof.nonJSThreadsCpuTime,
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
prof.topDownRoot.children.push(node);
|
|
281
|
+
}
|
|
231
282
|
serialize(profile, prof.topDownRoot, appendTimeEntryToSamples, stringTable, undefined, sourceMapper);
|
|
232
283
|
return new pprof_format_1.Profile(profile);
|
|
233
284
|
}
|
|
@@ -263,13 +314,17 @@ function buildLabels(labelSet, stringTable) {
|
|
|
263
314
|
* nanoseconds.
|
|
264
315
|
* @param intervalBytes - bytes allocated between samples.
|
|
265
316
|
*/
|
|
266
|
-
function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamplesPath, sourceMapper) {
|
|
317
|
+
function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamplesPath, sourceMapper, generateLabels) {
|
|
267
318
|
const appendHeapEntryToSamples = (entry, samples) => {
|
|
268
319
|
if (entry.node.allocations.length > 0) {
|
|
320
|
+
const labels = generateLabels
|
|
321
|
+
? buildLabels(generateLabels({ node: entry.node }), stringTable)
|
|
322
|
+
: [];
|
|
269
323
|
for (const alloc of entry.node.allocations) {
|
|
270
324
|
const sample = new pprof_format_1.Sample({
|
|
271
325
|
locationId: entry.stack,
|
|
272
326
|
value: [alloc.count, alloc.sizeBytes * alloc.count],
|
|
327
|
+
label: labels,
|
|
273
328
|
// TODO: add tag for allocation size
|
|
274
329
|
});
|
|
275
330
|
samples.push(sample);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-serializer.js","sourceRoot":"","sources":["../../ts/src/profile-serializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAWsB;
|
|
1
|
+
{"version":3,"file":"profile-serializer.js","sourceRoot":"","sources":["../../ts/src/profile-serializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAWsB;AAeT,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAwB/D,SAAS,mBAAmB,CAC1B,QAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,MAAM,KAAK,SAAS;QAC7B,QAAQ,CAAC,IAAI,KAAK,SAAS;QAC3B,QAAQ,CAAC,IAAI,GAAG,CAAC,CAClB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAChB,OAAqB,EACrB,IAAO,EACP,eAAwC,EACxC,WAAwB,EACxB,iBAA0B,EAC1B,YAA2B;IAE3B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEhD,MAAM,OAAO,GAAqB,IAAI,CAAC,QAAgB,CAAC,GAAG,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,EAAE;KACV,CAAC,CAAC,CAAC;IACJ,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;QAC7B,MAAM,IAAI,G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AU,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;QAClD,SAAS,EAAE,cAAc;QACzB,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,aAAa;KACtB,CAAC;IAEF,SAAS,CACP,OAAO,EACP,IAAI,EACJ,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,YAAY,CACb,CAAC;IAEF,OAAO,IAAI,sBAAO,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAhDD,oDAgDC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constants = exports.TimeProfiler = void 0;
|
|
3
|
+
exports.getNativeThreadId = exports.constants = exports.TimeProfiler = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright 2018 Google Inc. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -21,4 +21,5 @@ const findBinding = require('node-gyp-build');
|
|
|
21
21
|
const profiler = findBinding((0, path_1.join)(__dirname, '..', '..'));
|
|
22
22
|
exports.TimeProfiler = profiler.TimeProfiler;
|
|
23
23
|
exports.constants = profiler.constants;
|
|
24
|
+
exports.getNativeThreadId = profiler.getNativeThreadId;
|
|
24
25
|
//# sourceMappingURL=time-profiler-bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-profiler-bindings.js","sourceRoot":"","sources":["../../ts/src/time-profiler-bindings.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+BAA0B;AAE1B,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE7C,QAAA,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;AACrC,QAAA,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"time-profiler-bindings.js","sourceRoot":"","sources":["../../ts/src/time-profiler-bindings.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+BAA0B;AAE1B,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE7C,QAAA,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;AACrC,QAAA,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC/B,QAAA,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC"}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
17
|
-
import {
|
|
17
|
+
import { getNativeThreadId } from './time-profiler-bindings';
|
|
18
|
+
import { GenerateTimeLabelsFunction } from './v8-types';
|
|
18
19
|
type Microseconds = number;
|
|
19
20
|
type Milliseconds = number;
|
|
20
21
|
export interface TimeProfilerOptions {
|
|
@@ -32,15 +33,18 @@ export interface TimeProfilerOptions {
|
|
|
32
33
|
lineNumbers?: boolean;
|
|
33
34
|
withContexts?: boolean;
|
|
34
35
|
workaroundV8Bug?: boolean;
|
|
36
|
+
collectCpuTime?: boolean;
|
|
35
37
|
}
|
|
36
|
-
export declare function profile(
|
|
37
|
-
export declare function start(
|
|
38
|
-
export declare function stop(restart?: boolean, generateLabels?:
|
|
38
|
+
export declare function profile(options?: TimeProfilerOptions): Promise<import("pprof-format").Profile>;
|
|
39
|
+
export declare function start(options?: TimeProfilerOptions): void;
|
|
40
|
+
export declare function stop(restart?: boolean, generateLabels?: GenerateTimeLabelsFunction): import("pprof-format").Profile;
|
|
39
41
|
export declare function getState(): any;
|
|
40
42
|
export declare function setContext(context?: object): void;
|
|
43
|
+
export declare function getContext(): any;
|
|
41
44
|
export declare function isStarted(): boolean;
|
|
42
45
|
export declare function v8ProfilerStuckEventLoopDetected(): number;
|
|
43
46
|
export declare const constants: {
|
|
44
47
|
kSampleCount: any;
|
|
48
|
+
NON_JS_THREADS_FUNCTION_NAME: string;
|
|
45
49
|
};
|
|
46
|
-
export {
|
|
50
|
+
export { getNativeThreadId };
|
package/out/src/time-profiler.js
CHANGED
|
@@ -18,10 +18,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.constants = exports.v8ProfilerStuckEventLoopDetected = exports.isStarted = exports.setContext = exports.getState = exports.stop = exports.start = exports.profile = void 0;
|
|
21
|
+
exports.getNativeThreadId = exports.constants = exports.v8ProfilerStuckEventLoopDetected = exports.isStarted = exports.getContext = exports.setContext = exports.getState = exports.stop = exports.start = exports.profile = void 0;
|
|
22
22
|
const delay_1 = __importDefault(require("delay"));
|
|
23
23
|
const profile_serializer_1 = require("./profile-serializer");
|
|
24
24
|
const time_profiler_bindings_1 = require("./time-profiler-bindings");
|
|
25
|
+
Object.defineProperty(exports, "getNativeThreadId", { enumerable: true, get: function () { return time_profiler_bindings_1.getNativeThreadId; } });
|
|
26
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
25
27
|
const { kSampleCount } = time_profiler_bindings_1.constants;
|
|
26
28
|
const DEFAULT_INTERVAL_MICROS = 1000;
|
|
27
29
|
const DEFAULT_DURATION_MILLIS = 60000;
|
|
@@ -35,29 +37,36 @@ process.once('exit', () => {
|
|
|
35
37
|
if (isStarted())
|
|
36
38
|
stop();
|
|
37
39
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
const DEFAULT_OPTIONS = {
|
|
41
|
+
durationMillis: DEFAULT_DURATION_MILLIS,
|
|
42
|
+
intervalMicros: DEFAULT_INTERVAL_MICROS,
|
|
43
|
+
lineNumbers: false,
|
|
44
|
+
withContexts: false,
|
|
45
|
+
workaroundV8Bug: true,
|
|
46
|
+
collectCpuTime: false,
|
|
47
|
+
};
|
|
48
|
+
async function profile(options = {}) {
|
|
49
|
+
options = { ...DEFAULT_OPTIONS, ...options };
|
|
50
|
+
start(options);
|
|
51
|
+
await (0, delay_1.default)(options.durationMillis);
|
|
48
52
|
return stop();
|
|
49
53
|
}
|
|
50
54
|
exports.profile = profile;
|
|
51
55
|
// Temporarily retained for backwards compatibility with older tracer
|
|
52
|
-
function start(
|
|
56
|
+
function start(options = {}) {
|
|
57
|
+
options = { ...DEFAULT_OPTIONS, ...options };
|
|
53
58
|
if (gProfiler) {
|
|
54
59
|
throw new Error('Wall profiler is already started');
|
|
55
60
|
}
|
|
56
|
-
gProfiler = new time_profiler_bindings_1.TimeProfiler(
|
|
57
|
-
gSourceMapper = sourceMapper;
|
|
58
|
-
gIntervalMicros = intervalMicros;
|
|
61
|
+
gProfiler = new time_profiler_bindings_1.TimeProfiler({ ...options, isMainThread: node_worker_threads_1.isMainThread });
|
|
62
|
+
gSourceMapper = options.sourceMapper;
|
|
63
|
+
gIntervalMicros = options.intervalMicros;
|
|
59
64
|
gV8ProfilerStuckEventLoopDetected = 0;
|
|
60
65
|
gProfiler.start();
|
|
66
|
+
// If contexts are enabled, set an initial empty context
|
|
67
|
+
if (options.withContexts) {
|
|
68
|
+
setContext({});
|
|
69
|
+
}
|
|
61
70
|
}
|
|
62
71
|
exports.start = start;
|
|
63
72
|
function stop(restart = false, generateLabels) {
|
|
@@ -101,6 +110,13 @@ function setContext(context) {
|
|
|
101
110
|
gProfiler.context = context;
|
|
102
111
|
}
|
|
103
112
|
exports.setContext = setContext;
|
|
113
|
+
function getContext() {
|
|
114
|
+
if (!gProfiler) {
|
|
115
|
+
throw new Error('Wall profiler is not started');
|
|
116
|
+
}
|
|
117
|
+
return gProfiler.context;
|
|
118
|
+
}
|
|
119
|
+
exports.getContext = getContext;
|
|
104
120
|
function isStarted() {
|
|
105
121
|
return !!gProfiler;
|
|
106
122
|
}
|
|
@@ -110,5 +126,5 @@ function v8ProfilerStuckEventLoopDetected() {
|
|
|
110
126
|
return gV8ProfilerStuckEventLoopDetected;
|
|
111
127
|
}
|
|
112
128
|
exports.v8ProfilerStuckEventLoopDetected = v8ProfilerStuckEventLoopDetected;
|
|
113
|
-
exports.constants = { kSampleCount };
|
|
129
|
+
exports.constants = { kSampleCount, NON_JS_THREADS_FUNCTION_NAME: profile_serializer_1.NON_JS_THREADS_FUNCTION_NAME };
|
|
114
130
|
//# sourceMappingURL=time-profiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/src/time-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,kDAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/src/time-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,kDAA0B;AAE1B,6DAG8B;AAE9B,qEAIkC;AAkJ1B,kGApJN,0CAAiB,OAoJM;AAhJzB,6DAAiD;AAEjD,MAAM,EAAC,YAAY,EAAC,GAAG,kCAAiB,CAAC;AAEzC,MAAM,uBAAuB,GAAiB,IAAI,CAAC;AACnD,MAAM,uBAAuB,GAAiB,KAAK,CAAC;AAKpD,IAAI,SAAwD,CAAC;AAC7D,IAAI,aAAuC,CAAC;AAC5C,IAAI,eAA6B,CAAC;AAClC,IAAI,iCAAiC,GAAG,CAAC,CAAC;AAE1C;6DAC6D;AAC7D,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;IACxB,IAAI,SAAS,EAAE;QAAE,IAAI,EAAE,CAAC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;AAC3C,CAAC;AAFD,4EAEC;AAEY,QAAA,SAAS,GAAG,EAAC,YAAY,EAAE,4BAA4B,EAA5B,iDAA4B,EAAC,CAAC"}
|
package/out/src/v8-types.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export interface TimeProfile {
|
|
|
19
19
|
topDownRoot: TimeProfileNode;
|
|
20
20
|
/** Time in nanoseconds at which profile was started. */
|
|
21
21
|
startTime: number;
|
|
22
|
+
hasCpuTime?: boolean;
|
|
23
|
+
/** CPU time of non-JS threads, only reported for the main worker thread */
|
|
24
|
+
nonJSThreadsCpuTime?: number;
|
|
22
25
|
}
|
|
23
26
|
export interface ProfileNode {
|
|
24
27
|
name?: string;
|
|
@@ -31,6 +34,7 @@ export interface ProfileNode {
|
|
|
31
34
|
export interface TimeProfileNodeContext {
|
|
32
35
|
context: object;
|
|
33
36
|
timestamp: bigint;
|
|
37
|
+
cpuTime: number;
|
|
34
38
|
}
|
|
35
39
|
export interface TimeProfileNode extends ProfileNode {
|
|
36
40
|
hitCount: number;
|
|
@@ -46,3 +50,15 @@ export interface Allocation {
|
|
|
46
50
|
export interface LabelSet {
|
|
47
51
|
[key: string]: string | number;
|
|
48
52
|
}
|
|
53
|
+
export interface GenerateAllocationLabelsFunction {
|
|
54
|
+
({ node }: {
|
|
55
|
+
node: AllocationProfileNode;
|
|
56
|
+
}): LabelSet;
|
|
57
|
+
}
|
|
58
|
+
export interface GenerateTimeLabelsArgs {
|
|
59
|
+
node: TimeProfileNode;
|
|
60
|
+
context?: TimeProfileNodeContext;
|
|
61
|
+
}
|
|
62
|
+
export interface GenerateTimeLabelsFunction {
|
|
63
|
+
(args: GenerateTimeLabelsArgs): LabelSet;
|
|
64
|
+
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|