Skip to main content
Version: Next

EventLoopLoadSignal

Periodically measures event loop delay and reports overload when the delay exceeds a configured threshold.

Built by default; construct one yourself only to wrap or adapt it — see LoadSignal.

Implements

Index

Constructors

constructor

Properties

readonlyname

name: eventLoopInfo = 'eventLoopInfo'

This signal's key in the reported SystemInfo, also used in logging — so it must be unique among the signals of one ConcurrencySystem, which throws on a duplicate. The four built-in names (memInfo, eventLoopInfo, cpuInfo, storageBackendInfo) land in the correspondingly named SystemInfo fields rather than the loadSignalInfo bag; taking one over means switching that built-in off.

readonlyoverloadedRatio

overloadedRatio: number

Maximum ratio of overloaded snapshots in a sample before the signal is considered overloaded. For example, 0.2 means the signal fires when more than 20% of the sample window is overloaded.

Methods

getSample

  • Return snapshots for a recent time window (used for "current" status).


    Parameters

    • optionalsampleDurationMillis: number

      How far back to look, in milliseconds.

    Returns LoadSnapshot[]

start

  • start(context): Promise<void>
  • Start collecting snapshots, retaining at least the sample window named in the context. Called when the ConcurrencySystem starts — which may be a restart, so drop anything measured before it.


    Parameters

    Returns Promise<void>

stop

  • stop(): Promise<void>
  • Stop collecting snapshots. Called when the ConcurrencySystem shuts down.


    Returns Promise<void>