Files
klz-cables.com/.pnpm-store/v10/files/45/d9da8ad8c99842b6f6ec35a377209f77c9fa92790589c397009a54a03a2a113969493d3f205a03dd6819c7e4f38a662172b9ce1b674bf9002aa7bf5f316435
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

81 lines
2.5 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('./currentScopes.js');
const debugBuild = require('./debug-build.js');
const debugLogger = require('./utils/debug-logger.js');
function isProfilingIntegrationWithProfiler(
integration,
) {
return (
!!integration &&
typeof integration['_profiler'] !== 'undefined' &&
typeof integration['_profiler']['start'] === 'function' &&
typeof integration['_profiler']['stop'] === 'function'
);
}
/**
* Starts the Sentry continuous profiler.
* This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.
* In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.
*/
function startProfiler() {
const client = currentScopes.getClient();
if (!client) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('ProfilingIntegration');
if (!integration) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('ProfilingIntegration is not available');
return;
}
if (!isProfilingIntegrationWithProfiler(integration)) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('Profiler is not available on profiling integration.');
return;
}
integration._profiler.start();
}
/**
* Stops the Sentry continuous profiler.
* Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
*/
function stopProfiler() {
const client = currentScopes.getClient();
if (!client) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('ProfilingIntegration');
if (!integration) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('ProfilingIntegration is not available');
return;
}
if (!isProfilingIntegrationWithProfiler(integration)) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('Profiler is not available on profiling integration.');
return;
}
integration._profiler.stop();
}
/**
* Profiler namespace for controlling the profiler in 'manual' mode.
*
* Requires the `nodeProfilingIntegration` from the `@sentry/profiling-node` package.
*/
const profiler = {
startProfiler,
stopProfiler,
};
exports.profiler = profiler;
//# sourceMappingURL=profiling.js.map