1.0.5 • Published 11 months ago

@hisorange/sensor v1.0.5

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
11 months ago

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
1.0.5

11 months ago

1.0.1

11 months ago