New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@datadog/pprof

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/pprof - npm Package Compare versions

Comparing version 5.4.0 to 6.0.0-pre-2cbc15d

prebuilds/darwin-arm64/node-102.node

1

out/src/index.d.ts

@@ -19,2 +19,3 @@ import * as heapProfiler from './heap-profiler';

kSampleCount: any;
GARBAGE_COLLECTION_FUNCTION_NAME: string;
NON_JS_THREADS_FUNCTION_NAME: string;

@@ -21,0 +22,0 @@ };

3

out/src/profile-serializer.d.ts

@@ -19,3 +19,4 @@ /**

import { AllocationProfileNode, GenerateAllocationLabelsFunction, GenerateTimeLabelsFunction, TimeProfile } from './v8-types';
export declare const NON_JS_THREADS_FUNCTION_NAME = "(non-JS threads)";
export declare const NON_JS_THREADS_FUNCTION_NAME = "Non JS threads activity";
export declare const GARBAGE_COLLECTION_FUNCTION_NAME = "Garbage Collection";
/**

@@ -22,0 +23,0 @@ * Converts v8 time profile into into a profile proto.

@@ -18,5 +18,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeHeapProfile = exports.serializeTimeProfile = exports.NON_JS_THREADS_FUNCTION_NAME = void 0;
exports.serializeHeapProfile = exports.serializeTimeProfile = exports.GARBAGE_COLLECTION_FUNCTION_NAME = exports.NON_JS_THREADS_FUNCTION_NAME = void 0;
const pprof_format_1 = require("pprof-format");
exports.NON_JS_THREADS_FUNCTION_NAME = '(non-JS threads)';
exports.NON_JS_THREADS_FUNCTION_NAME = 'Non JS threads activity';
exports.GARBAGE_COLLECTION_FUNCTION_NAME = 'Garbage Collection';
function isGeneratedLocation(location) {

@@ -59,4 +60,2 @@ return (location.column !== undefined &&

}
if (node.name === '(idle)' || node.name === '(program)')
continue;
const stack = entry.stack;

@@ -195,2 +194,67 @@ const location = getLocation(node, sourceMapper);

}
/** Perform some modifications on time profile:
* - Add non-JS thread activity node if available
* - Remove `(idle)` and `(program)` nodes
* - Convert `(garbage collector)` node to `Garbage Collection`
* - Put `non-JS thread activity` node and `Garbage Collection` under a top level `Node.js` node
* This function does not change the input profile.
*/
function updateTimeProfile(prof) {
const newTopLevelChildren = [];
let runtimeNode;
function getRuntimeNode() {
if (!runtimeNode) {
runtimeNode = {
name: 'Node.js',
scriptName: '',
scriptId: 0,
lineNumber: 0,
columnNumber: 0,
children: [],
hitCount: 0,
};
newTopLevelChildren.push(runtimeNode);
}
return runtimeNode;
}
for (const child of prof.topDownRoot.children) {
if (child.name === '(idle)' || child.name === '(program)') {
continue;
}
if (child.name === '(garbage collector)') {
// Create a new node to avoid modifying the input one
const newChild = {
...child,
name: exports.GARBAGE_COLLECTION_FUNCTION_NAME,
};
getRuntimeNode().children.push(newChild);
}
else {
newTopLevelChildren.push(child);
}
}
if (prof.hasCpuTime && prof.nonJSThreadsCpuTime) {
const node = {
name: exports.NON_JS_THREADS_FUNCTION_NAME,
scriptName: '',
scriptId: 0,
lineNumber: 0,
columnNumber: 0,
children: [],
hitCount: 0,
contexts: [
{
context: {},
timestamp: BigInt(0),
cpuTime: prof.nonJSThreadsCpuTime,
},
],
};
getRuntimeNode().children.push(node);
}
return {
...prof,
topDownRoot: { ...prof.topDownRoot, children: newTopLevelChildren },
};
}
/**

@@ -275,22 +339,4 @@ * Converts v8 time profile into into a profile proto.

};
if (prof.hasCpuTime && prof.nonJSThreadsCpuTime) {
const node = {
name: exports.NON_JS_THREADS_FUNCTION_NAME,
scriptName: '',
scriptId: 0,
lineNumber: 0,
columnNumber: 0,
children: [],
hitCount: 0,
contexts: [
{
context: {},
timestamp: BigInt(0),
cpuTime: prof.nonJSThreadsCpuTime,
},
],
};
prof.topDownRoot.children.push(node);
}
serialize(profile, prof.topDownRoot, appendTimeEntryToSamples, stringTable, undefined, sourceMapper);
const updatedProf = updateTimeProfile(prof);
serialize(profile, updatedProf.topDownRoot, appendTimeEntryToSamples, stringTable, undefined, sourceMapper);
return new pprof_format_1.Profile(profile);

@@ -297,0 +343,0 @@ }

@@ -48,4 +48,5 @@ /**

kSampleCount: any;
GARBAGE_COLLECTION_FUNCTION_NAME: string;
NON_JS_THREADS_FUNCTION_NAME: string;
};
export { getNativeThreadId };

@@ -130,3 +130,7 @@ "use strict";

exports.v8ProfilerStuckEventLoopDetected = v8ProfilerStuckEventLoopDetected;
exports.constants = { kSampleCount, NON_JS_THREADS_FUNCTION_NAME: profile_serializer_1.NON_JS_THREADS_FUNCTION_NAME };
exports.constants = {
kSampleCount,
GARBAGE_COLLECTION_FUNCTION_NAME: profile_serializer_1.GARBAGE_COLLECTION_FUNCTION_NAME,
NON_JS_THREADS_FUNCTION_NAME: profile_serializer_1.NON_JS_THREADS_FUNCTION_NAME,
};
//# sourceMappingURL=time-profiler.js.map
{
"name": "@datadog/pprof",
"version": "5.4.0",
"version": "6.0.0-pre-2cbc15d",
"description": "pprof support for Node.js",

@@ -5,0 +5,0 @@ "repository": "datadog/pprof-nodejs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc