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

loopbench

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopbench

Benchmark your event loop

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

loopbench

Benchmark your event loop, extracted from hapi, hoek, heavy and boom.

Install

To install loopbench, simply use npm:

npm i loopbench --save

Example

See example.js.

API


loopbench([opts])

Creates a new instance of loopbench.

Options:

  • sampleInterval: the interval at which the eventLoop should be sampled, defaults to 5.
  • limit: the maximum amount of delay that is tollerated before overLimit becomes true, and the load event is emitted, defaults to 42.

Events:

  • load, emitted when instance.delay > instance.limit
  • unload, emitted when overLimit goes from true and false

instance.delay

The delay in milliseconds (and fractions) from the expected run. It might be negative (in older nodes).


instance.limit

The maximum amount of delay that is tollerated before overLimit becomes true, and the load event is emitted.


instance.overLimit

Is true if the instance.delay > instance.limit.


instance.stop()

Stops the sampling.

License

Copyright Matteo Collina 2015-2022, Licensed under MIT.

Keywords

FAQs

Package last updated on 24 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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