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.

29 lines (28 loc) 1.12 kB
import type { Configuration } from '../configuration'; import type { LoadSnapshot } from './load_signal'; import { SnapshotStore } from './load_signal'; import type { SystemInfo } from './system_status'; export interface CpuSnapshot extends LoadSnapshot { usedRatio: number; ticks?: { idle: number; total: number; }; } export interface CpuLoadSignalOptions { overloadedRatio?: number; snapshotHistoryMillis?: number; config: Configuration; } /** * Tracks CPU usage via `SYSTEM_INFO` events and reports overload when * the platform or local OS metrics indicate the CPU is overloaded. */ // @ts-ignore optional peer dependency or compatibility with es2022 export declare function createCpuLoadSignal(options: CpuLoadSignalOptions): Omit<import("./load_signal").LoadSignal, "getSample"> & { store: SnapshotStore<CpuSnapshot>; handle: (payload: SystemInfo) => void; getSample(sampleDurationMillis?: number): CpuSnapshot[]; }; /** @internal Return type for backward compat in Snapshotter facade */ export type CpuLoadSignal = ReturnType<typeof createCpuLoadSignal>;