84 lines
2.1 KiB
JavaScript
84 lines
2.1 KiB
JavaScript
// Metro module 890 (f891).
|
|
import { SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME } from "./Module839";
|
|
import { HermesBuiltin } from "../_hermes/prelude";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
export function convertSpanJsonToTransactionEvent(a0) {
|
|
const data = {
|
|
...a0.data
|
|
};
|
|
let profile_id = a0.profile_id;
|
|
if (profile_id) {
|
|
const r6 = {};
|
|
r6[SEMANTIC_ATTRIBUTE_PROFILE_ID] = a0.profile_id;
|
|
profile_id = r6;
|
|
}
|
|
HermesBuiltin.copyDataProperties(data, profile_id);
|
|
let exclusive_time = a0.exclusive_time;
|
|
if (exclusive_time) {
|
|
const r30 = {};
|
|
r30[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] = a0.exclusive_time;
|
|
exclusive_time = r30;
|
|
}
|
|
HermesBuiltin.copyDataProperties(data, exclusive_time);
|
|
return {
|
|
type: "transaction",
|
|
timestamp: a0.timestamp,
|
|
start_timestamp: a0.start_timestamp,
|
|
transaction: a0.description,
|
|
contexts: {
|
|
trace: {
|
|
trace_id: a0.trace_id,
|
|
span_id: a0.span_id,
|
|
parent_span_id: a0.parent_span_id,
|
|
op: a0.op,
|
|
status: a0.status,
|
|
origin: a0.origin,
|
|
data
|
|
}
|
|
},
|
|
measurements: a0.measurements
|
|
};
|
|
}
|
|
export function convertTransactionEventToSpanJson(a0) {
|
|
let r4 = a0.contexts?.trace;
|
|
if (r4 == null) {
|
|
r4 = {};
|
|
}
|
|
let trace_id = r4.trace_id;
|
|
const parent_span_id = r4.parent_span_id;
|
|
let span_id = r4.span_id;
|
|
const { status, origin, data, op } = r4;
|
|
let data2 = data;
|
|
if (data2 == null) {
|
|
data2 = {};
|
|
}
|
|
if (span_id == null) {
|
|
span_id = "";
|
|
}
|
|
let start_timestamp = a0.start_timestamp;
|
|
if (start_timestamp == null) {
|
|
start_timestamp = 0;
|
|
}
|
|
if (trace_id == null) {
|
|
trace_id = "";
|
|
}
|
|
return {
|
|
data: data2,
|
|
description: a0.transaction,
|
|
op,
|
|
parent_span_id,
|
|
span_id,
|
|
start_timestamp,
|
|
status,
|
|
timestamp: a0.timestamp,
|
|
trace_id,
|
|
origin,
|
|
profile_id: data == null ? void 0 : data[SEMANTIC_ATTRIBUTE_PROFILE_ID],
|
|
exclusive_time: data == null ? void 0 : data[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],
|
|
measurements: a0.measurements,
|
|
is_segment: true
|
|
};
|
|
}
|