lib/index.js
function(time, metrics) {
	var metricTypes = ['gauges', 'timer_data', 'timers', 'counters', 'sets'];

	metricTypes.forEach(function(type, i){
		var obj;

		for (var key in metrics[type]) {
			obj = aggregate[type](time, key, metrics[type][key]);

			insert(obj.db, obj.col, obj.data, function(err){
				if (err) console.log(err);
			});
		};
	});
}
function(time, metrics) {
	var metricTypes = ['gauges', 'timer_data', 'timers', 'counters', 'sets'];

	metricTypes.forEach(function(type, i){
		var obj;

		for (var key in metrics[type]) {
			obj = aggregate[type](time, key, metrics[type][key]);

			insert(obj.db, obj.col, obj.data, function(err){
				if (err) console.log(err);
			});
		};
	});
}
function ( time , metrics ) { var metricTypes = [ 'gauges' , 'timer_data' , 'timers' , 'counters' , 'sets' ] ; metricTypes . forEach ( function ( type , i ) { var obj ; for ( var key in metrics [ type ] ) { obj = aggregate [ type ] ( time , key , metrics [ type ] [ key ] ) ; insert ( obj . db , obj . col , obj . data , function ( err ) { if ( err ) console . log ( err ) ; } ) ; } ; } ) ; }
our `flush` event handler
our flush event handler