Metrics collection framework

This commit is contained in:
kpdecker
2013-08-25 14:14:33 -05:00
parent 74369f724c
commit 672aeda17f
4 changed files with 79 additions and 11 deletions
+14
View File
@@ -0,0 +1,14 @@
var fs = require('fs');
var metrics = fs.readdirSync(__dirname);
metrics.forEach(function(metric) {
if (metric === 'index.js' || !/(.*)\.js$/.test(metric)) {
return;
}
var name = RegExp.$1;
metric = require('./' + name);
if (metric instanceof Function) {
module.exports[name] = metric;
}
});