1.0.0 • Published 9 years ago
inlean v1.0.0
inlean
Lean influxdb stats collector
Install
$ npm install --save inlean
Test
$ npm test
Usage
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:
host
the influx db host (ex.http://localhost:8086
) requireddb
the database name optionaltags
an 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:
name
the metric name requiredval
the value requiredtags
an object containing the tags to apply optionalts
a timestamp optional
Client#writeInt(opts, cb)
opts
must be an object and can have the following properties:
name
the metric name requiredval
the value requiredtags
an object containing the tags to apply optionalts
a timestamp optional
Client#writeBool(opts, cb)
opts
must be an object and can have the following properties:
name
the metric name requiredkey
the key to write (defaults tovalue
) optionalval
the value requiredtrue
andfalse
will be correctly serialized
tags
an object containing the tags to apply optionalts
a timestamp optional
Client#writeString(opts, cb)
opts
must be an object and can have the following properties:
name
the metric name requiredkey
the key to write (defaults tovalue
) optionalval
the value requiredtags
an object containing the tags to apply optionalts
a timestamp optional
TODO
- only send in batches to limit http activity
Author
Evan Lucas
License
MIT (See LICENSE
for more info)
1.0.0
9 years ago