2.6.2 • Published 5 years ago

chpr-blocked v2.6.2

Weekly downloads
4
License
ISC
Repository
-
Last release
5 years ago

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'
2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago