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

chpr-blocked

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chpr-blocked

Inspired from tj/blocked, but configurable with environment variables

  • 2.6.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

CircleCI codecov

chpr-blocked is a tiny utility to monitor event loop blocking, inspired from tj/blocked, but configurable with environment variables.

When the event loop is blocked for more than a set threshold (defaults to 100ms), a log is emitted (using the specified level) using chpr-logger, and metrics are sent (increment + timing).

There is a "warmup delay" (defaults to 2000ms), because it's ok to use a lot of CPU in at the statup of the node app (e.g. to require most of the app code).

Installation

Install the package.

npm i chpr-blocked --save

Then require the module in the entry point in your code (e.g. server.js, worker.js, etc...).

require('chpr-blocked').start();

Configuration

The configuration is done with environment variables.

NameDescriptionDefault
BLOCKED_DELAYThe tolerated warmup time after requiring chpr-blocked, milliseconds2000
BLOCKED_THRESHOLDThe threshold above which a log/metric is emitted, once the warmup delay is over100
BLOCKED_LOGGER_LEVELThe logger level to apply on a blocked process'info'

FAQs

Package last updated on 05 Sep 2019

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