influx-db-builder
v1.0.2
Published
A database builder above node influx library
Downloads
3
Maintainers
Readme
influx-db-builder
A database builder above node-influx
Install
npm install influx-db-builder
Example
var bunyan = require( 'bunyan' );
var influx = require( 'influx' );
var buildInfluxDb = require( 'influx-db-builder' );
var db = {
continuousQueries: {
clicks_per_hour: 'SELECT COUNT(name) INTO clicksCount_1h FROM clicks GROUP BY time(1h)',
clicks_per_day: 'SELECT COUNT(name) INTO clicksCount_1d FROM clicks GROUP BY time(1d)',
winks_per_day: 'SELECT COUNT(name) INTO winksCount_1d FROM winks GROUP BY time(1d)'
}
};
var log = bunyan.createLogger( { name: 'example' } );
var client = influx( { host: 'localhost', database: 'test } );
buildInfluxDb( client, db, log, function( err ) {
log.debug( 'influx database built' );
} );