@evo/cantal-js

A nodejs library for cantal

Stats

StarsIssuesVersionUpdatedCreatedSize
@evo/cantal-js
100.3.02 years ago4 years agoMinified + gzip package size for @evo/cantal-js in KB

Readme

cantal-js

Will collect metrics from your nodejs application

Usage example

import cantal from '@evo/cantal-js';

const requests = new cantal.Counter({
    group: "incoming",
    metric: "requests"
});

createServer((req, res) => {
    requests.incr();
})

// need to be called somewhere once
cantal.start();

ENV

CANTAL_PATH - path for storing metrics

Metrics

Counter

const requests = new cantal.Counter({
    group: "incoming",
    metric: "requests"
});

requests.incr();

Integer

const memory = new cantal.Integer({
    group: "v8-stats",
    metric: "malloced_memory"
});

memory.set(stats.memory);
// memory.incr();
// memory.decr();

V8 metrics

Some v8 metrics will be collected by default in group v8-stats

  • new_space_used_size - heap new space used size
  • old_space_used_size - heap old space used size
  • code_space_used_size - heap code space used size
  • map_space_used_size - heap map space used size
  • large_object_space_used_size - heap large object space used size
  • malloced_memory - allocated memory for the process

Details for collected metrics here

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.