@hisorange/sensor
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Sensor

Set of sensors for monitoring the performance of your application or library.

ActuationSensor

Counts the number actuations, useful to trace total number of queries, requests, etc.

const sensor = new ActuationSensor('queries');

for (let i = 0; i < 10; i++) {
  sensor.actuate();
}

console.log(sensor.read()); // 10

MemorySensor

Measures the memory usage of the current process.

const sensor = new MemorySensor();

console.log(sensor.read()); // 123456 bytes

Readme

Keywords

none

Package Sidebar

Install

npm i @hisorange/sensor

Weekly Downloads

1

Version

1.0.5

License

GPL-3.0

Unpacked Size

6.87 kB

Total Files

15

Last publish

Collaborators

  • hisorangenpm