@datadog/pprof
Advanced tools
Comparing version 4.0.0-pre-05c5dd4 to 4.0.0-pre-2f3b78c
@@ -18,3 +18,3 @@ /** | ||
import { SourceMapper } from './sourcemapper/sourcemapper'; | ||
import { AllocationProfileNode, LabelSet, TimeProfile } from './v8-types'; | ||
import { AllocationProfileNode, LabelSet, TimeProfile, TimeProfileNodeContext } from './v8-types'; | ||
/** | ||
@@ -27,3 +27,3 @@ * Converts v8 time profile into into a profile proto. | ||
*/ | ||
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?: (context: object) => LabelSet): Profile; | ||
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?: (context: TimeProfileNodeContext) => LabelSet): Profile; | ||
/** | ||
@@ -30,0 +30,0 @@ * Converts v8 heap profile into into a profile proto. |
@@ -186,3 +186,3 @@ "use strict"; | ||
for (const context of entry.node.contexts || []) { | ||
const labels = generateLabels ? generateLabels(context) : context; | ||
const labels = generateLabels ? generateLabels(context) : context.context; | ||
if (Object.keys(labels).length > 0) { | ||
@@ -223,12 +223,17 @@ const sample = new pprof_format_1.Sample({ | ||
for (const [key, value] of Object.entries(labelSet)) { | ||
if (typeof value === 'number' || typeof value === 'string') { | ||
const label = new pprof_format_1.Label({ | ||
key: stringTable.dedup(key), | ||
num: typeof value === 'number' ? value : undefined, | ||
str: typeof value === 'string' | ||
? stringTable.dedup(value) | ||
: undefined, | ||
}); | ||
labels.push(label); | ||
const labelInput = { | ||
key: stringTable.dedup(key), | ||
}; | ||
switch (typeof value) { | ||
case 'string': | ||
labelInput.str = stringTable.dedup(value); | ||
break; | ||
case 'number': | ||
case 'bigint': | ||
labelInput.num = value; | ||
break; | ||
default: | ||
continue; | ||
} | ||
labels.push(new pprof_format_1.Label(labelInput)); | ||
} | ||
@@ -235,0 +240,0 @@ return labels; |
@@ -17,3 +17,3 @@ /** | ||
import { SourceMapper } from './sourcemapper/sourcemapper'; | ||
import { LabelSet } from './v8-types'; | ||
import { LabelSet, TimeProfileNodeContext } from './v8-types'; | ||
type Microseconds = number; | ||
@@ -39,3 +39,3 @@ type Milliseconds = number; | ||
export declare function start({ intervalMicros, durationMillis, sourceMapper, lineNumbers, withContexts, workaroundV8Bug, }: TimeProfilerOptions): void; | ||
export declare function stop(restart?: boolean, generateLabels?: (context: object) => LabelSet): import("pprof-format").Profile; | ||
export declare function stop(restart?: boolean, generateLabels?: (context: TimeProfileNodeContext) => LabelSet): import("pprof-format").Profile; | ||
export declare function getState(): any; | ||
@@ -42,0 +42,0 @@ export declare function setContext(context?: object): void; |
@@ -31,5 +31,9 @@ /** | ||
} | ||
export interface TimeProfileNodeContext { | ||
context: object; | ||
timestamp: bigint; | ||
} | ||
export interface TimeProfileNode extends ProfileNode { | ||
hitCount: number; | ||
contexts?: object[]; | ||
contexts?: TimeProfileNodeContext[]; | ||
} | ||
@@ -36,0 +40,0 @@ export interface AllocationProfileNode extends ProfileNode { |
{ | ||
"name": "@datadog/pprof", | ||
"version": "4.0.0-pre-05c5dd4", | ||
"version": "4.0.0-pre-2f3b78c", | ||
"description": "pprof support for Node.js", | ||
@@ -50,3 +50,3 @@ "repository": "datadog/pprof-nodejs", | ||
"mocha": "^10.2.0", | ||
"nan": "^2.17.0", | ||
"nan": "^2.18.0", | ||
"nyc": "^15.1.0", | ||
@@ -53,0 +53,0 @@ "sinon": "^15.2.0", |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 7 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9315388
93
1477
60