Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

event-loop-delay-check

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-loop-delay-check - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

1

dist/services/elu-monitor/elu-monitor.interface.d.ts
export type EluMonitorServiceOptions = {
checkIntervalMs?: number;
criticalThreshold?: number;
criticalDelayMs: number;
statusCheckCallback?: (isCritical: boolean, eluUtilization: number) => void;

@@ -5,0 +6,0 @@ };

3

dist/services/elu-monitor/elu-monitor.service.d.ts

@@ -8,6 +8,7 @@ import { IEventLoopCheckService } from '../event-loop-check/event-loop-check.interface';

private _criticalThreshold;
private _criticalDelayMs;
private _checkIntervalMs;
private _statusCheckCallback?;
private _isCriticalStatus;
setConfig({ criticalThreshold, statusCheckCallback, checkIntervalMs }: EluMonitorServiceOptions): void;
setConfig({ criticalThreshold, statusCheckCallback, checkIntervalMs, criticalDelayMs, }: EluMonitorServiceOptions): void;
create(): void;

@@ -14,0 +15,0 @@ destroy(): void;

@@ -9,7 +9,9 @@ "use strict";

this._criticalThreshold = 90;
this._criticalDelayMs = 5000;
this._checkIntervalMs = 500;
this._isCriticalStatus = false;
}
setConfig({ criticalThreshold, statusCheckCallback, checkIntervalMs }) {
setConfig({ criticalThreshold, statusCheckCallback, checkIntervalMs, criticalDelayMs, }) {
this._criticalThreshold = criticalThreshold ?? this._criticalThreshold;
this._criticalDelayMs = criticalDelayMs ?? this._criticalDelayMs;
this._checkIntervalMs = Math.max(checkIntervalMs ?? this._checkIntervalMs);

@@ -32,5 +34,7 @@ this._statusCheckCallback = statusCheckCallback;

const eluUtilizations = this._eventLoopDelayCheckService.getEventLoopUtilizations();
const isCritical = eluUtilizations > this._criticalThreshold;
this._isCriticalStatus = isCritical;
this?._statusCheckCallback(isCritical, eluUtilizations);
const eluDelay = this._eventLoopDelayCheckService.getEventLoopDelay();
const isCriticalThreshold = eluUtilizations > this._criticalThreshold;
const isCriticalDelay = eluDelay > this._criticalDelayMs;
this._isCriticalStatus = isCriticalThreshold && isCriticalDelay;
this?._statusCheckCallback(isCriticalThreshold, eluUtilizations);
}

@@ -37,0 +41,0 @@ }

{
"name": "event-loop-delay-check",
"version": "0.0.6",
"version": "0.0.7",
"description": "Check the event loop delay",

@@ -5,0 +5,0 @@ "repository": "https://github.com/unrealmanu/event-loop-delay-check",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc