Name Last Update
example Loading commit data...
test Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
README.md Loading commit data...
index.js Loading commit data...
package.json Loading commit data...

influx-batch-sender

buffer message and send them in a bulk.

useage

const Sender = require('../index');

const sender = new Sender({
    host: 'influxd.yoho.cn',
    db: 'web-apm',
    measurement: 'api-duration',
    duration: 2000,
    records:200
});

setInterval(() => {
    sender.addMessage({
        tags: {
            reqid: 'sdasda'+Math.random(),
            route: 'test'
        },
        fields: {
            dasd: "d123asda"
        }
    });
}, Math.random() * 100)