New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/toobusy-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/toobusy-js - npm Package Compare versions

Comparing version

to
0.5.2

55

toobusy-js/index.d.ts
// Type definitions for toobusy-js 0.5
// Project: https://github.com/STRML/node-toobusy
// Definitions by: Arne Schubert <https://github.com/atd-schubert>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -8,13 +9,59 @@

/**
* Main export function.
* @return True if node process is too busy.
*/
declare function toobusy_js(): boolean;
declare namespace toobusy_js {
function interval(newInterval: number): number;
/**
* Sets or gets the current check interval.
* If you want more sensitive checking, set a faster (lower) interval. A lower maxLag can also create a more
* sensitive check.
* @param [newInterval] New interval to set. If not provided, will return the existing interval.
* @return New or existing interval.
*/
function interval(newInterval?: number): number;
/**
* Returns last lag reading from last check interval.
* @return Lag in ms.
*/
function lag(): number;
function maxLag(newLag: number): number;
function smoothingFactor(newFactor: number): number;
/**
* Set or get the current max latency threshold. Default is 70ms.
*
* Note that if event loop lag goes over this threshold, the process is not always 'too busy' - the farther
* it goes over the threshold, the more likely the process will be considered too busy.
*
* The percentage is equal to the percent over the max lag threshold. So 1.25x over the maxLag will indicate
* too busy 25% of the time. 2x over the maxLag threshold will indicate too busy 100% of the time.
* @param [newLag] New maxLag (highwater) threshold.
* @return New or existing maxLag (highwater) threshold.
*/
function maxLag(newLag?: number): number;
/**
* Set or get the smoothing factor. Default is 0.3333....
*
* The smoothing factor per the standard exponential smoothing formula "αtn + (1-α)tn-1"
* See: https://en.wikipedia.org/wiki/Exponential_smoothing
*
* @param [newFactor] New smoothing factor.
* @return New or existing smoothing factor.
*/
function smoothingFactor(newFactor?: number): number;
/**
* Shuts down toobusy.
*
* Not necessary to call this manually, only do this if you know what you're doing. `unref()` is called
* on toobusy's check interval, so it will never keep the server open.
*/
function shutdown(): void;
/**
* Registers an event listener for lag events,
* optionally specify a minimum value threshold for events being emitted
* @param fn Function of form onLag(value: number) => void
* @param [threshold=maxLag] Optional minimum lag value for events to be emitted
*/
function onLag(fn: (lag: number) => void, threshold?: number): void;
function started(): boolean;
}

9

toobusy-js/package.json
{
"name": "@types/toobusy-js",
"version": "0.5.1",
"version": "0.5.2",
"description": "TypeScript definitions for toobusy-js",

@@ -11,2 +11,7 @@ "license": "MIT",

"githubUsername": "atd-schubert"
},
{
"name": "BendingBender",
"url": "https://github.com/BendingBender",
"githubUsername": "BendingBender"
}

@@ -22,4 +27,4 @@ ],

"dependencies": {},
"typesPublisherContentHash": "b18bab87446a2da96f5b8eeb5108598616a6293697d167d5285ca1f07a367cd4",
"typesPublisherContentHash": "3c4271d57dc9c60a592496629bd2f63c6f47a7325f49305b475a54c5afc055c0",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Sun, 18 Nov 2018 17:42:12 GMT
* Last updated: Thu, 06 Dec 2018 00:19:56 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Arne Schubert <https://github.com/atd-schubert>.
These definitions were written by Arne Schubert <https://github.com/atd-schubert>, BendingBender <https://github.com/BendingBender>.