Repository URL to install this package:
|
Version:
0.7.0 ▾
|
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";const path=require("path"),lag=require("event-loop-lag")(1e3);let eventLoopStats;exports.payloadPrefix="libuv";const nativeModuleLoader=require("./util/nativeModuleRetry")({nativeModuleName:"event-loop-stats",moduleRoot:path.join(__dirname,".."),message:"Could not load event-loop-stats. You will only see limited event loop information in Instana for this application. This typically occurs when native addons could not be built during module installation (npm install/yarn) or when npm install --no-optional or yarn --ignore-optional have been used to install dependencies. See the instructions to learn more about the requirements of the collector: https://www.ibm.com/docs/de/obi/current?topic=nodejs-collector-installation#native-add-ons"});function sense(){var stats;return eventLoopStats?((stats=eventLoopStats.sense()).statsSupported=!0,stats):{statsSupported:!1}}nativeModuleLoader.once("loaded",eventLoopStats_=>{eventLoopStats=eventLoopStats_}),nativeModuleLoader.once("failed",()=>{exports.currentPayload.statsSupported=!1}),Object.defineProperty(exports,"currentPayload",{get:function(){var stats=sense();return stats.lag=Math.round(100*lag())/100,stats}});