Rocky_Mountain_Vending/.pnpm-store/v10/files/3b/c91830c9270b5d2ecdeb242a5906d7e4f8e4eedabbd2aa49c8eb101b279c51076652245467ba8e8ace1942c814d0a79d188c4be0040750f81921742a223aea
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

73 lines
2.1 KiB
Text

import { getClient } from './currentScopes.js';
import { DEBUG_BUILD } from './debug-build.js';
import { debug } from './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 = getClient();
if (!client) {
DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('ProfilingIntegration');
if (!integration) {
DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');
return;
}
if (!isProfilingIntegrationWithProfiler(integration)) {
DEBUG_BUILD && 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 = getClient();
if (!client) {
DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('ProfilingIntegration');
if (!integration) {
DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');
return;
}
if (!isProfilingIntegrationWithProfiler(integration)) {
DEBUG_BUILD && debug.warn('Profiler is not available on profiling integration.');
return;
}
integration._profiler.stop();
}
const profiler = {
startProfiler,
stopProfiler,
};
export { profiler };
//# sourceMappingURL=profiling.js.map