@sentry/profiling-node 9.0.0-alpha.0 → 9.0.0-alpha.2
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/LICENSE +1 -1
- package/lib/cjs/index.js +19 -223
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +21 -224
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +1 -1
- package/lib/types/integration.d.ts.map +1 -1
- package/lib/types/spanProfileUtils.d.ts.map +1 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +11 -30
- package/binding.gyp +0 -20
- package/bindings/cpu_profiler.cc +0 -1226
- package/lib/sentry_cpu_profiler-darwin-arm64-108.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-arm64-115.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-arm64-127.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-108.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-115.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-127.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-108.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-115.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-127.node +0 -0
- package/lib/types/cpu_profiler.d.ts +0 -16
- package/lib/types/cpu_profiler.d.ts.map +0 -1
- package/lib/types-ts3.8/cpu_profiler.d.ts +0 -16
- package/scripts/binaries.js +0 -27
- package/scripts/check-build.js +0 -56
- package/scripts/copy-target.js +0 -27
|
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
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PrivateV8CpuProfilerBindings, RawChunkCpuProfile, RawThreadCpuProfile, V8CpuProfilerBindings } from './types';
|
|
2
|
-
import type { ProfileFormat } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Imports cpp bindings based on the current platform and architecture.
|
|
5
|
-
*/
|
|
6
|
-
export declare function importCppBindingsModule(): PrivateV8CpuProfilerBindings;
|
|
7
|
-
declare const PrivateCpuProfilerBindings: PrivateV8CpuProfilerBindings;
|
|
8
|
-
declare class Bindings implements V8CpuProfilerBindings {
|
|
9
|
-
startProfiling(name: string): void;
|
|
10
|
-
stopProfiling(name: string, format: ProfileFormat.THREAD): RawThreadCpuProfile | null;
|
|
11
|
-
stopProfiling(name: string, format: ProfileFormat.CHUNK): RawChunkCpuProfile | null;
|
|
12
|
-
}
|
|
13
|
-
declare const CpuProfilerBindings: Bindings;
|
|
14
|
-
export { PrivateCpuProfilerBindings };
|
|
15
|
-
export { CpuProfilerBindings };
|
|
16
|
-
//# sourceMappingURL=cpu_profiler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cpu_profiler.d.ts","sourceRoot":"","sources":["../../src/cpu_profiler.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAU7C;;GAEG;AAEH,wBAAgB,uBAAuB,IAAI,4BAA4B,CA6ItE;AAED,QAAA,MAAM,0BAA0B,EAAE,4BAAwD,CAAC;AAE3F,cAAM,QAAS,YAAW,qBAAqB;IACtC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAelC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,mBAAmB,GAAG,IAAI;IACrF,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,GAAG,kBAAkB,GAAG,IAAI;CAwB3F;AAED,QAAA,MAAM,mBAAmB,UAAiB,CAAC;AAE3C,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PrivateV8CpuProfilerBindings, RawChunkCpuProfile, RawThreadCpuProfile, V8CpuProfilerBindings } from './types';
|
|
2
|
-
import { ProfileFormat } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Imports cpp bindings based on the current platform and architecture.
|
|
5
|
-
*/
|
|
6
|
-
export declare function importCppBindingsModule(): PrivateV8CpuProfilerBindings;
|
|
7
|
-
declare const PrivateCpuProfilerBindings: PrivateV8CpuProfilerBindings;
|
|
8
|
-
declare class Bindings implements V8CpuProfilerBindings {
|
|
9
|
-
startProfiling(name: string): void;
|
|
10
|
-
stopProfiling(name: string, format: ProfileFormat.THREAD): RawThreadCpuProfile | null;
|
|
11
|
-
stopProfiling(name: string, format: ProfileFormat.CHUNK): RawChunkCpuProfile | null;
|
|
12
|
-
}
|
|
13
|
-
declare const CpuProfilerBindings: Bindings;
|
|
14
|
-
export { PrivateCpuProfilerBindings };
|
|
15
|
-
export { CpuProfilerBindings };
|
|
16
|
-
//# sourceMappingURL=cpu_profiler.d.ts.map
|
package/scripts/binaries.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const os = require('os');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const abi = require('node-abi');
|
|
5
|
-
const libc = require('detect-libc');
|
|
6
|
-
|
|
7
|
-
function getModuleName() {
|
|
8
|
-
const stdlib = libc.familySync();
|
|
9
|
-
const platform = process.env['BUILD_PLATFORM'] || os.platform();
|
|
10
|
-
const arch = process.env['BUILD_ARCH'] || os.arch();
|
|
11
|
-
|
|
12
|
-
if (platform === 'darwin' && arch === 'arm64') {
|
|
13
|
-
const identifier = [platform, 'arm64', abi.getAbi(process.versions.node, 'node')].filter(Boolean).join('-');
|
|
14
|
-
return `sentry_cpu_profiler-${identifier}.node`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const identifier = [platform, arch, stdlib, abi.getAbi(process.versions.node, 'node')].filter(Boolean).join('-');
|
|
18
|
-
|
|
19
|
-
return `sentry_cpu_profiler-${identifier}.node`;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const source = path.join(__dirname, '..', 'build', 'Release', 'sentry_cpu_profiler.node');
|
|
23
|
-
const target = path.join(__dirname, '..', 'lib', getModuleName());
|
|
24
|
-
|
|
25
|
-
module.exports.source = source;
|
|
26
|
-
module.exports.target = target;
|
|
27
|
-
module.exports.getModuleName = getModuleName;
|
package/scripts/check-build.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// This is a build script, so some logging is desirable as it allows
|
|
2
|
-
// us to follow the code path that triggered the error.
|
|
3
|
-
/* eslint-disable no-console */
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const child_process = require('child_process');
|
|
6
|
-
const binaries = require('./binaries.js');
|
|
7
|
-
|
|
8
|
-
function clean(err) {
|
|
9
|
-
return err.toString().trim();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function recompileFromSource() {
|
|
13
|
-
console.log('@sentry/profiling-node: Compiling from source...');
|
|
14
|
-
let spawn = child_process.spawnSync('npm', ['run', 'build:bindings:configure'], {
|
|
15
|
-
stdio: ['inherit', 'inherit', 'pipe'],
|
|
16
|
-
env: process.env,
|
|
17
|
-
shell: true,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
if (spawn.status !== 0) {
|
|
21
|
-
console.log('@sentry/profiling-node: Failed to configure gyp');
|
|
22
|
-
console.log('@sentry/profiling-node:', clean(spawn.stderr));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
spawn = child_process.spawnSync('npm', ['run', 'build:bindings'], {
|
|
27
|
-
stdio: ['inherit', 'inherit', 'pipe'],
|
|
28
|
-
env: process.env,
|
|
29
|
-
shell: true,
|
|
30
|
-
});
|
|
31
|
-
if (spawn.status !== 0) {
|
|
32
|
-
console.log('@sentry/profiling-node: Failed to build bindings');
|
|
33
|
-
console.log('@sentry/profiling-node:', clean(spawn.stderr));
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (fs.existsSync(binaries.target)) {
|
|
39
|
-
try {
|
|
40
|
-
console.log(`@sentry/profiling-node: Precompiled binary found, attempting to load ${binaries.target}`);
|
|
41
|
-
require(binaries.target);
|
|
42
|
-
console.log('@sentry/profiling-node: Precompiled binary found, skipping build from source.');
|
|
43
|
-
} catch (e) {
|
|
44
|
-
console.log('@sentry/profiling-node: Precompiled binary found but failed loading');
|
|
45
|
-
console.log('@sentry/profiling-node:', e);
|
|
46
|
-
try {
|
|
47
|
-
recompileFromSource();
|
|
48
|
-
} catch (e) {
|
|
49
|
-
console.log('@sentry/profiling-node: Failed to compile from source');
|
|
50
|
-
throw e;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
console.log('@sentry/profiling-node: No precompiled binary found');
|
|
55
|
-
recompileFromSource();
|
|
56
|
-
}
|
package/scripts/copy-target.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// This is a build script, so some logging is desirable as it allows
|
|
2
|
-
// us to follow the code path that triggered the error.
|
|
3
|
-
/* eslint-disable no-console */
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const process = require('process');
|
|
7
|
-
const binaries = require('./binaries.js');
|
|
8
|
-
|
|
9
|
-
const build = path.resolve(__dirname, '..', 'lib');
|
|
10
|
-
|
|
11
|
-
if (!fs.existsSync(build)) {
|
|
12
|
-
fs.mkdirSync(build, { recursive: true });
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const source = path.join(__dirname, '..', 'build', 'Release', 'sentry_cpu_profiler.node');
|
|
16
|
-
const target = path.join(__dirname, '..', 'lib', binaries.getModuleName());
|
|
17
|
-
|
|
18
|
-
if (!fs.existsSync(source)) {
|
|
19
|
-
console.log('Source file does not exist:', source);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
} else {
|
|
22
|
-
if (fs.existsSync(target)) {
|
|
23
|
-
console.log('Target file already exists, overwriting it');
|
|
24
|
-
}
|
|
25
|
-
console.log('Renaming', source, 'to', target);
|
|
26
|
-
fs.renameSync(source, target);
|
|
27
|
-
}
|