SystemStatus
Index
Constructors
Methods
Constructors
constructor
Parameters
options: SystemStatusOptions = {}
Returns SystemStatus
Methods
getCurrentStatus
Returns an SystemInfo object with the following structure:
{
isSystemIdle: Boolean,
memInfo: Object,
eventLoopInfo: Object,
cpuInfo: Object
}Where the
isSystemIdle
property is set tofalse
if the system has been overloaded in the lastoptions.currentHistorySecs
seconds, andtrue
otherwise.Returns SystemInfo
getHistoricalStatus
Returns an SystemInfo object with the following structure:
{
isSystemIdle: Boolean,
memInfo: Object,
eventLoopInfo: Object,
cpuInfo: Object
}Where the
isSystemIdle
property is set tofalse
if the system has been overloaded in the full history of the Snapshotter (which is configurable in the Snapshotter) andtrue
otherwise.Returns SystemInfo
Provides a simple interface to reading system status from a Snapshotter instance. It only exposes two functions SystemStatus.getCurrentStatus and SystemStatus.getHistoricalStatus. The system status is calculated using a weighted average of overloaded messages in the snapshots, with the weights being the time intervals between the snapshots. Each resource is calculated separately and the system is overloaded whenever at least one resource is overloaded. The class is used by the AutoscaledPool class.
SystemStatus.getCurrentStatus returns a boolean that represents the current status of the system. The length of the current timeframe in seconds is configurable by the
currentHistorySecs
option and represents the max age of snapshots to be considered for the calculation.SystemStatus.getHistoricalStatus returns a boolean that represents the long-term status of the system. It considers the full snapshot history available in the Snapshotter instance.