From 82c1dc6b43d9ebb9a70a8defca233d40d0357a27 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 17 Dec 2025 13:32:31 +0100 Subject: [PATCH 1/2] Fix accidental removal of getMetrics function (#250) * Fix accidental removal of getMetrics function * Import time profiler through top-level profiler file, ensuring that it tests re-exporting of functions etc. --- ts/src/index.ts | 1 + ts/test/test-time-profiler.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/src/index.ts b/ts/src/index.ts index 51cceddb..42454629 100644 --- a/ts/src/index.ts +++ b/ts/src/index.ts @@ -40,6 +40,7 @@ export const time = { v8ProfilerStuckEventLoopDetected: timeProfiler.v8ProfilerStuckEventLoopDetected, getState: timeProfiler.getState, + getMetrics: timeProfiler.getMetrics, constants: timeProfiler.constants, }; diff --git a/ts/test/test-time-profiler.ts b/ts/test/test-time-profiler.ts index 1c887525..d7359578 100644 --- a/ts/test/test-time-profiler.ts +++ b/ts/test/test-time-profiler.ts @@ -16,7 +16,7 @@ import delay from 'delay'; import * as sinon from 'sinon'; -import * as time from '../src/time-profiler'; +import {time, getNativeThreadId} from '../src'; import * as v8TimeProfiler from '../src/time-profiler-bindings'; import {timeProfile, v8TimeProfile} from './profiles-for-tests'; import {hrtime} from 'process'; @@ -739,7 +739,7 @@ describe('Time Profiler', () => { describe('getNativeThreadId', () => { it('should return a number', () => { - const threadId = time.getNativeThreadId(); + const threadId = getNativeThreadId(); assert.ok(typeof threadId === 'number'); assert.ok(threadId > 0); }); From 6b2d8371ac10f56e6908ac2a407949a62d47818d Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 17 Dec 2025 13:41:17 +0100 Subject: [PATCH 2/2] v5.13.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10ad1a02..7c42b2fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@datadog/pprof", - "version": "5.13.0", + "version": "5.13.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@datadog/pprof", - "version": "5.13.0", + "version": "5.13.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index f1317ad9..5cb4e842 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@datadog/pprof", - "version": "5.13.0", + "version": "5.13.1", "description": "pprof support for Node.js", "repository": { "type": "git",