decord/source/__polyfill/12xxx/module_12931.js
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

68 lines
2.4 KiB
JavaScript

// Module ID: 12931
// Function ID: 12932
// Dependencies: [12924, 12919, 12932, 12920, 12892]
// Exports: sampleSpan
// Module 12931
import _mod12924 from "module_12924" /* 12924 */;
require = arg1;
const dependencyMap = arg6;
export const sampleSpan = function sampleSpan(tracesSampler, normalizedRequest) {
if (obj.hasTracingEnabled(tracesSampler)) {
const isolationScope = tmp(12919).getIsolationScope();
const obj2 = {};
const merged = Object.assign(normalizedRequest);
obj2.normalizedRequest = normalizedRequest.normalizedRequest || isolationScope.getScopeData().sdkProcessingMetadata.normalizedRequest;
if (typeof tracesSampler.tracesSampler === "function") {
let num = tracesSampler.tracesSampler(obj2);
} else if (undefined !== obj2.parentSampled) {
num = obj2.parentSampled;
} else {
num = 1;
if (undefined !== tracesSampler.tracesSampleRate) {
num = tracesSampler.tracesSampleRate;
}
}
const tmpResult = tmp(12919);
const parseSampleRateResult = tmp(12932).parseSampleRate(num);
if (undefined === parseSampleRateResult) {
if (tmp(12920).DEBUG_BUILD) {
const logger3 = tmp(12892).logger;
logger3.warn("[Tracing] Discarding transaction because of invalid sample rate.");
}
const items = [false];
let items3 = items;
} else if (parseSampleRateResult) {
const _Math = Math;
if (Math.random() < parseSampleRateResult) {
const items1 = [true, parseSampleRateResult];
let items2 = items1;
} else {
if (tmp(12920).DEBUG_BUILD) {
const logger2 = tmp(12892).logger;
const _Number = Number;
const _HermesInternal = HermesInternal;
logger2.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = " + Number(num) + ")");
}
items2 = [false, parseSampleRateResult];
}
} else {
if (tmp(12920).DEBUG_BUILD) {
const logger = tmp(12892).logger;
let str = "a negative sampling decision was inherited or tracesSampleRate is set to 0";
if (typeof tracesSampler.tracesSampler === "function") {
str = "tracesSampler returned 0 or false";
}
logger.log(`[Tracing] Discarding transaction because ${str}`);
}
items3 = [false, parseSampleRateResult];
}
return items3;
} else {
const items4 = [false];
return items4;
}
obj = _mod12924;
};