diff options
Diffstat (limited to 'shared/logger/node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js')
| -rw-r--r-- | shared/logger/node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shared/logger/node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js b/shared/logger/node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js new file mode 100644 index 0000000..ecb4873 --- /dev/null +++ b/shared/logger/node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js @@ -0,0 +1,25 @@ +/** + * Checks if a given value is a valid measurement value. + */ +function isMeasurementValue(value) { + return typeof value === 'number' && isFinite(value); +} + +/** + * Helper function to start child on transactions. This function will make sure that the transaction will + * use the start timestamp of the created child span if it is earlier than the transactions actual + * start timestamp. + */ +function _startChild(transaction, { startTimestamp, ...ctx }) { + if (startTimestamp && transaction.startTimestamp > startTimestamp) { + transaction.startTimestamp = startTimestamp; + } + + return transaction.startChild({ + startTimestamp, + ...ctx, + }); +} + +export { _startChild, isMeasurementValue }; +//# sourceMappingURL=utils.js.map |
