41 lines
1.7 KiB
JavaScript
41 lines
1.7 KiB
JavaScript
// Metro module 6466 (f6467).
|
|
import { getClient } from "./Module6395";
|
|
import { DEBUG_BUILD } from "./Module6396";
|
|
import { logger } from "./consoleSandbox_6368";
|
|
export const profiler = {
|
|
startProfiler: function startProfiler() {
|
|
const client = getClient();
|
|
if (client) {
|
|
const integrationByName = client.getIntegrationByName("ProfilingIntegration");
|
|
if (integrationByName) {
|
|
if (!!integrationByName && integrationByName._profiler !== void 0 && typeof integrationByName._profiler.start === "function" && typeof integrationByName._profiler.stop === "function") {
|
|
integrationByName._profiler.start();
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("Profiler is not available on profiling integration.");
|
|
}
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("ProfilingIntegration is not available");
|
|
}
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("No Sentry client available, profiling is not started");
|
|
}
|
|
},
|
|
stopProfiler: function stopProfiler() {
|
|
const client = getClient();
|
|
if (client) {
|
|
const integrationByName = client.getIntegrationByName("ProfilingIntegration");
|
|
if (integrationByName) {
|
|
if (!!integrationByName && integrationByName._profiler !== void 0 && typeof integrationByName._profiler.start === "function" && typeof integrationByName._profiler.stop === "function") {
|
|
integrationByName._profiler.stop();
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("Profiler is not available on profiling integration.");
|
|
}
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("ProfilingIntegration is not available");
|
|
}
|
|
} else if (DEBUG_BUILD) {
|
|
logger.warn("No Sentry client available, profiling is not started");
|
|
}
|
|
}
|
|
};
|