From 38a90bd5a249457939841dba9f5f7cebaf671ebd Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 17 Dec 2025 10:38:12 +0100 Subject: [PATCH 1/2] Fix accidental removal of getMetrics function --- ts/src/index.ts | 1 + 1 file changed, 1 insertion(+) 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, }; From 74775542da9b6f1c0dc35ae0e65a7b3420d0c2b7 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 17 Dec 2025 10:49:19 +0100 Subject: [PATCH 2/2] Import time profiler through top-level profiler file, ensuring that it tests re-exporting of functions etc. --- ts/test/test-time-profiler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); });