decord/source/__polyfill/12xxx/module_12965.js
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

68 lines
2.4 KiB
JavaScript

// Module ID: 12965
// Function ID: 12966
// Dependencies: [12958, 12953, 12966, 12954, 12926]
// Exports: sampleSpan
// Module 12965
import _mod12958 from "module_12958" /* 12958 */;
require = arg1;
const dependencyMap = arg6;
export const sampleSpan = function sampleSpan(tracesSampler, normalizedRequest) {
if (obj.hasTracingEnabled(tracesSampler)) {
const isolationScope = tmp(12953).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(12953);
const parseSampleRateResult = tmp(12966).parseSampleRate(num);
if (undefined === parseSampleRateResult) {
if (tmp(12954).DEBUG_BUILD) {
const logger3 = tmp(12926).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(12954).DEBUG_BUILD) {
const logger2 = tmp(12926).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(12954).DEBUG_BUILD) {
const logger = tmp(12926).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 = _mod12958;
};