UNPKG

@crawlee/core

Version:

The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.

24 lines (23 loc) 1.02 kB
import type { LoadSnapshot } from './load_signal'; import { SnapshotStore } from './load_signal'; export interface EventLoopSnapshot extends LoadSnapshot { exceededMillis: number; } export interface EventLoopLoadSignalOptions { eventLoopSnapshotIntervalSecs?: number; maxBlockedMillis?: number; overloadedRatio?: number; snapshotHistoryMillis?: number; } /** * Periodically measures event loop delay and reports overload when the * delay exceeds a configured threshold. */ // @ts-ignore optional peer dependency or compatibility with es2022 export declare function createEventLoopLoadSignal(options?: EventLoopLoadSignalOptions): Omit<import("./load_signal").LoadSignal, "getSample"> & { store: SnapshotStore<EventLoopSnapshot>; handle: (cb: () => unknown) => void; getSample(sampleDurationMillis?: number): EventLoopSnapshot[]; }; /** @internal Return type for backward compat in Snapshotter facade */ export type EventLoopLoadSignal = ReturnType<typeof createEventLoopLoadSignal>;