1.0.0 • Published 10 years ago
inlean v1.0.0
inlean
Lean influxdb stats collector
Install
$ npm install --save inleanTest
$ npm testUsage
var Inlean = require('inlean')
var client = new Inlean({
host: 'http://127.0.0.1:8086'
, db: 'biscuits'
, tags: {
service: 'db'
}
})Client(opts)
opts must be an object and can have the following properties:
hostthe influx db host (ex.http://localhost:8086) requireddbthe database name optionaltagsan object containing the tags to be used for every request optional
Note: the db is not automatically created. Use Client#createDb to create
Client#setDb(name)
sets the current database
Client#createDb(name, cb)
creates a database with the given name
Client#writeFloat(opts, cb)
opts must be an object and can have the following properties:
namethe metric name requiredvalthe value requiredtagsan object containing the tags to apply optionaltsa timestamp optional
Client#writeInt(opts, cb)
opts must be an object and can have the following properties:
namethe metric name requiredvalthe value requiredtagsan object containing the tags to apply optionaltsa timestamp optional
Client#writeBool(opts, cb)
opts must be an object and can have the following properties:
namethe metric name requiredkeythe key to write (defaults tovalue) optionalvalthe value requiredtrueandfalsewill be correctly serialized
tagsan object containing the tags to apply optionaltsa timestamp optional
Client#writeString(opts, cb)
opts must be an object and can have the following properties:
namethe metric name requiredkeythe key to write (defaults tovalue) optionalvalthe value requiredtagsan object containing the tags to apply optionaltsa timestamp optional
TODO
- only send in batches to limit http activity
Author
Evan Lucas
License
MIT (See LICENSE for more info)
1.0.0
10 years ago