@sentry/profiling-node
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -14,5 +14,6 @@ "use strict"; | ||
return function wrappedStartTransaction(transactionContext, customSamplingContext) { | ||
var _a, _b; | ||
var _a; | ||
const client = this.getClient(); | ||
// @ts-expect-error profilesSampleRate is not part of the options type yet | ||
const profilesSampleRate = (_b = (_a = this.getClient()) === null || _a === void 0 ? void 0 : _a.getOptions().profilesSampleRate) !== null && _b !== void 0 ? _b : undefined; | ||
const profilesSampleRate = (_a = client === null || client === void 0 ? void 0 : client.getOptions().profilesSampleRate) !== null && _a !== void 0 ? _a : undefined; | ||
const transaction = startTransaction.call(this, transactionContext, customSamplingContext); | ||
@@ -37,3 +38,8 @@ // We create "unique" transaction names to avoid concurrent transactions with same names | ||
const originalFinish = transaction.finish.bind(transaction); | ||
// @TODO remove this | ||
const start = transaction.startChild({ | ||
op: 'sentry.startProfiling' | ||
}); | ||
cpu_profiler_1.CpuProfilerBindings.startProfiling(uniqueTransactionName); | ||
start.finish(); | ||
if ((0, env_1.isDebugBuild)()) { | ||
@@ -58,3 +64,8 @@ utils_1.logger.log('[Profiling] started profiling transaction: ' + transactionContext.name); | ||
} | ||
// @TODO remove this | ||
const stop = transaction.startChild({ | ||
op: 'sentry.stopProfiling' | ||
}); | ||
profile = cpu_profiler_1.CpuProfilerBindings.stopProfiling(uniqueTransactionName); | ||
stop.finish(); | ||
if (maxDurationTimeoutID) { | ||
@@ -87,6 +98,2 @@ global.clearTimeout(maxDurationTimeoutID); | ||
const profile = onProfileHandler(); | ||
// If we receive a profile, set the logging mode that was used as a tag | ||
if (profile) { | ||
transaction.setTag('profiler_logging_mode', profile.profiler_logging_mode); | ||
} | ||
// @ts-expect-error profile is not a part of sdk metadata so we expect error until it becomes part of the official SDK. | ||
@@ -93,0 +100,0 @@ transaction.setMetadata({ profile }); |
{ | ||
"name": "@sentry/profiling-node", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Sampling based nodejs profiler.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46073
515