code: 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);
  			});
  		};
  	});
  }
docs: our `flush` event handler