72 lines
3.6 KiB
JavaScript
72 lines
3.6 KiB
JavaScript
/* Metro module 7408; source: unknown; dependencies: [7401, 7396, 7409, 7397, 7369] */
|
|
import * as Module07369Module from './module-07369.js'; /* Metro dependency 7369 */
|
|
import * as DEBUG_BUILDModule from './module-07397-DEBUG_BUILD.js'; /* Metro dependency 7397 */
|
|
import * as HasTracingEnabledModule from './module-07401-hasTracingEnabled.js'; /* Metro dependency 7401 */
|
|
|
|
function _fun59698(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7586:6, offset: 0x016efdd0, size: 66 bytes, params: 8, frame: 16
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.sampleSpan = sampleSpan_59699;
|
|
function sampleSpan_59699(a0, a1) { // fn#59699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7586:92, offset: 0x016efe12, size: 630 bytes, params: 3, frame: 22
|
|
var tracesSampleRate;
|
|
var r4;
|
|
var items2;
|
|
var r0;
|
|
var value2;
|
|
var isolationScope;
|
|
var normalizedRequest;
|
|
var Object;
|
|
var value4;
|
|
var sampleRate;
|
|
const DEBUG_BUILD = (DEBUG_BUILDModule).DEBUG_BUILD;
|
|
const logger = (Module07369Module).logger;
|
|
var Math;
|
|
if (HasTracingEnabledModule.hasTracingEnabled(a0)) {
|
|
value2 = 1;
|
|
isolationScope = require(dependencyMap[value2]).getIsolationScope();
|
|
normalizedRequest = isolationScope.getScopeData().sdkProcessingMetadata.normalizedRequest;
|
|
Object = global.Object;
|
|
value4 = Object.assign({}, a1, {normalizedRequest: a1.normalizedRequest || normalizedRequest});
|
|
if (typeof a0.tracesSampler === 'function') {
|
|
r4 = a0.tracesSampler(value4);
|
|
} else if (value4.parentSampled !== undefined) {
|
|
r4 = value4.parentSampled;
|
|
} else {
|
|
tracesSampleRate = a0.tracesSampleRate;
|
|
tracesSampleRate = tracesSampleRate === undefined ? value2 : a0.tracesSampleRate;
|
|
r4 = tracesSampleRate;
|
|
}
|
|
sampleRate = (require(7409) /* metro dependency 7409 */).parseSampleRate(r4);
|
|
if (sampleRate === undefined) {
|
|
if (DEBUG_BUILD) {
|
|
logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');
|
|
}
|
|
r0 = [false];
|
|
} else if (sampleRate) {
|
|
Math = global.Math;
|
|
if (Math.random() < sampleRate) {
|
|
items2 = [true, sampleRate];
|
|
} else {
|
|
if (DEBUG_BUILD) {
|
|
logger.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = " + global.Number(r4) + ')');
|
|
}
|
|
items2 = [false, sampleRate];
|
|
}
|
|
r0 = items2;
|
|
} else {
|
|
if (DEBUG_BUILD) {
|
|
logger.log('[Tracing] Discarding transaction because ' + (typeof a0.tracesSampler !== 'function' ? 'a negative sampling decision was inherited or tracesSampleRate is set to 0' : 'tracesSampler returned 0 or false'));
|
|
}
|
|
r0 = [false, sampleRate];
|
|
}
|
|
return r0;
|
|
}
|
|
return [false];
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun59698, 7408, [7401, 7396, 7409, 7397,
|
|
7369]) /* metro module 7408, dependencies: [7401, 7396, 7409, 7397, 7369] */;
|