@sentry/apm
Advanced tools
Comparing version 5.13.0 to 5.13.1
@@ -7,12 +7,19 @@ // tslint:disable:max-classes-per-file | ||
var utils_1 = require("@sentry/utils"); | ||
var INITIAL_TIME = Date.now(); | ||
var performanceFallback = { | ||
now: function () { | ||
return INITIAL_TIME - Date.now(); | ||
}, | ||
}; | ||
var crossPlatformPerformance = (function () { | ||
if (utils_1.isNodeEnv()) { | ||
var performance_1 = utils_1.dynamicRequire(module, 'perf_hooks').performance; | ||
return performance_1; | ||
try { | ||
var perfHooks = utils_1.dynamicRequire(module, 'perf_hooks'); | ||
return perfHooks.performance; | ||
} | ||
catch (_) { | ||
return performanceFallback; | ||
} | ||
} | ||
return (utils_1.getGlobalObject().performance || { | ||
now: function () { | ||
return Date.now(); | ||
}, | ||
}); | ||
return utils_1.getGlobalObject().performance || performanceFallback; | ||
})(); | ||
@@ -19,0 +26,0 @@ // TODO: Should this be exported? |
@@ -6,12 +6,19 @@ // tslint:disable:max-classes-per-file | ||
import { dropUndefinedKeys, dynamicRequire, getGlobalObject, isInstanceOf, isNodeEnv, logger, timestampWithMs, uuid4, } from '@sentry/utils'; | ||
var INITIAL_TIME = Date.now(); | ||
var performanceFallback = { | ||
now: function () { | ||
return INITIAL_TIME - Date.now(); | ||
}, | ||
}; | ||
var crossPlatformPerformance = (function () { | ||
if (isNodeEnv()) { | ||
var performance_1 = dynamicRequire(module, 'perf_hooks').performance; | ||
return performance_1; | ||
try { | ||
var perfHooks = dynamicRequire(module, 'perf_hooks'); | ||
return perfHooks.performance; | ||
} | ||
catch (_) { | ||
return performanceFallback; | ||
} | ||
} | ||
return (getGlobalObject().performance || { | ||
now: function () { | ||
return Date.now(); | ||
}, | ||
}); | ||
return getGlobalObject().performance || performanceFallback; | ||
})(); | ||
@@ -18,0 +25,0 @@ // TODO: Should this be exported? |
{ | ||
"name": "@sentry/apm", | ||
"version": "5.13.0", | ||
"version": "5.13.1", | ||
"description": "Extensions for APM", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
224436
2572