3.7.0 • Published 2 years ago

inspector-vm v3.7.0

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

inspector-vm

NodeJS VM Metric Collector

Take a look at the Documentation.

install

This library is meant to be used with typescript / nodejs.

npm install --save inspector-vm

basic usage

import { MetricRegistry } from "inspector-metrics";
import {
    V8EventLoop,
    V8MemoryMetrics,
    V8GCMetrics,
    V8ProcessMetrics,
} from "inspector-vm";

// get a registry
const registry: MetricRegistry = ...;

// instance the memory metric, contains
//   - space statistics
//   - memory statistics
const memoryMetrics: V8MemoryMetrics = new V8MemoryMetrics("v8");
//   - gc statistics
const gc: V8GCMetrics = new V8GCMetrics("gc", registry.getDefaultClock());
//   - event loop delay / latency
const eventLoop: V8EventLoop = new V8EventLoop("eventLoop");
//   - cpu_usage (system, user, total)
//   - active_handles
//   - active_requests
const processMetric: V8ProcessMetrics = new V8ProcessMetrics("process");

// metric is registered und the name "v8"
registry.registerMetric(memoryMetrics);
// metric is registered und the name "gc"
registry.registerMetric(gc);
// metric is registered und the name "eventLoop"
registry.registerMetric(eventLoop);
// metric is registered und the name "process"
registry.registerMetric(processMetric);

// setup reporter ...

// note that unstopped metrics can cause the application to keep running
memoryMetrics.stop();
gc.stop();
eventLoop.stop();
processMetric.stop();

License

MIT

3.7.0

2 years ago

3.6.0

3 years ago

3.5.0

4 years ago

3.4.0

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.0

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago