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
1 line
3.9 KiB
Plaintext
1 line
3.9 KiB
Plaintext
{"version":3,"file":"profiling.js","sources":["../../src/profiling.ts"],"sourcesContent":["import { getClient } from './currentScopes';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { Profiler, ProfilingIntegration } from './types-hoist/profiling';\nimport { debug } from './utils/debug-logger';\n\nfunction isProfilingIntegrationWithProfiler(\n integration: ProfilingIntegration | undefined,\n): integration is ProfilingIntegration {\n return (\n !!integration &&\n typeof integration['_profiler'] !== 'undefined' &&\n typeof integration['_profiler']['start'] === 'function' &&\n typeof integration['_profiler']['stop'] === 'function'\n );\n}\n/**\n * Starts the Sentry continuous profiler.\n * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.\n * 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.\n */\nfunction startProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration');\n\n if (!integration) {\n DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');\n return;\n }\n\n if (!isProfilingIntegrationWithProfiler(integration)) {\n DEBUG_BUILD && debug.warn('Profiler is not available on profiling integration.');\n return;\n }\n\n integration._profiler.start();\n}\n\n/**\n * Stops the Sentry continuous profiler.\n * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.\n */\nfunction stopProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration');\n if (!integration) {\n DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');\n return;\n }\n\n if (!isProfilingIntegrationWithProfiler(integration)) {\n DEBUG_BUILD && debug.warn('Profiler is not available on profiling integration.');\n return;\n }\n\n integration._profiler.stop();\n}\n\n/**\n * Profiler namespace for controlling the profiler in 'manual' mode.\n *\n * Requires the `nodeProfilingIntegration` from the `@sentry/profiling-node` package.\n */\nexport const profiler: Profiler = {\n startProfiler,\n stopProfiler,\n};\n"],"names":[],"mappings":";;;;AAKA,SAAS,kCAAkC;AAC3C,EAAE,WAAW;AACb,EAAuC;AACvC,EAAE;AACF,IAAI,CAAC,CAAC,WAAA;AACN,IAAI,OAAO,WAAW,CAAC,WAAW,CAAA,KAAM,WAAA;AACxC,IAAI,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC,OAAO,CAAA,KAAM,UAAA;AACjD,IAAI,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,MAAM;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,GAAS;AAC/B,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;AAC5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,eAAe,KAAK,CAAC,IAAI,CAAC,sDAAsD,CAAC;AACrF,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,cAAc,MAAM,CAAC,oBAAoB,CAAuB,sBAAsB,CAAC;;AAE/F,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,eAAe,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC;AACtE,IAAI;AACJ,EAAE;;AAEF,EAAE,IAAI,CAAC,kCAAkC,CAAC,WAAW,CAAC,EAAE;AACxD,IAAI,eAAe,KAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC;AACpF,IAAI;AACJ,EAAE;;AAEF,EAAE,WAAW,CAAC,SAAS,CAAC,KAAK,EAAE;AAC/B;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