1.0.5 • Published 11 months ago
@hisorange/sensor v1.0.5
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