From 069bc15030225393f7d05521505316066464bdbd Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 19 Nov 2024 16:49:25 +0530 Subject: feat(ext/node): perf_hooks.monitorEventLoopDelay() (#26905) Fixes https://github.com/denoland/deno/issues/20961 Depends on https://github.com/denoland/deno_core/pull/965 and https://github.com/denoland/deno_core/pull/966 --- ext/node/polyfills/perf_hooks.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/node/polyfills/perf_hooks.ts') diff --git a/ext/node/polyfills/perf_hooks.ts b/ext/node/polyfills/perf_hooks.ts index d92b925b5..ec76b3ce2 100644 --- a/ext/node/polyfills/perf_hooks.ts +++ b/ext/node/polyfills/perf_hooks.ts @@ -8,6 +8,7 @@ import { performance as shimPerformance, PerformanceEntry, } from "ext:deno_web/15_performance.js"; +import { EldHistogram } from "ext:core/ops"; class PerformanceObserver { static supportedEntryTypes: string[] = []; @@ -89,10 +90,11 @@ const performance: ) => shimPerformance.dispatchEvent(...args), }; -const monitorEventLoopDelay = () => - notImplemented( - "monitorEventLoopDelay from performance", - ); +function monitorEventLoopDelay(options = {}) { + const { resolution = 10 } = options; + + return new EldHistogram(resolution); +} export default { performance, -- cgit v1.2.3