This commit is contained in:
Steve Sanbeg 2012-01-20 12:45:48 -05:00
Родитель cf82c66c2f
Коммит bd81674a51
3 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -1,5 +1,5 @@
var fs = require('fs')
, sys = require('sys')
, util = require('util')
var Configurator = function (file) {
@ -8,7 +8,7 @@ var Configurator = function (file) {
var oldConfig = {};
this.updateConfig = function () {
sys.log('reading config file: ' + file);
util.log('reading config file: ' + file);
fs.readFile(file, function (err, data) {
if (err) { throw err; }
@ -26,7 +26,7 @@ var Configurator = function (file) {
});
};
sys.inherits(Configurator, process.EventEmitter);
util.inherits(Configurator, process.EventEmitter);
exports.Configurator = Configurator;

Просмотреть файл

@ -1,5 +1,5 @@
var dgram = require('dgram')
, sys = require('sys')
, util = require('util')
, net = require('net')
, config = require('./config')
@ -28,13 +28,13 @@ config.configFile(process.argv[2], function (config, oldConfig) {
if (config.debug) {
if (debugInt !== undefined) { clearInterval(debugInt); }
debugInt = setInterval(function () {
sys.log("Counters:\n" + sys.inspect(counters) + "\nTimers:\n" + sys.inspect(timers));
util.log("Counters:\n" + util.inspect(counters) + "\nTimers:\n" + util.inspect(timers));
}, config.debugInterval || 10000);
}
if (server === undefined) {
server = dgram.createSocket('udp4', function (msg, rinfo) {
if (config.dumpMessages) { sys.log(msg.toString()); }
if (config.dumpMessages) { util.log(msg.toString()); }
var bits = msg.toString().split(':');
var key = bits.shift()
.replace(/\s+/g, '_')
@ -49,7 +49,7 @@ config.configFile(process.argv[2], function (config, oldConfig) {
var sampleRate = 1;
var fields = bits[i].split("|");
if (fields[1] === undefined) {
sys.log('Bad line: ' + fields);
util.log('Bad line: ' + fields);
stats['messages']['bad_lines_seen']++;
continue;
}
@ -107,12 +107,12 @@ config.configFile(process.argv[2], function (config, oldConfig) {
break;
case "counters":
stream.write(sys.inspect(counters) + "\n");
stream.write(util.inspect(counters) + "\n");
stream.write("END\n\n");
break;
case "timers":
stream.write(sys.inspect(timers) + "\n");
stream.write(util.inspect(timers) + "\n");
stream.write("END\n\n");
break;
@ -131,7 +131,7 @@ config.configFile(process.argv[2], function (config, oldConfig) {
server.bind(config.port || 8125);
mgmtServer.listen(config.mgmt_port || 8126);
sys.log("server is up");
util.log("server is up");
var flushInterval = Number(config.flushInterval || 10000);
@ -198,7 +198,7 @@ config.configFile(process.argv[2], function (config, oldConfig) {
var graphite = net.createConnection(config.graphitePort, config.graphiteHost);
graphite.addListener('error', function(connectionException){
if (config.debug) {
sys.log(connectionException);
util.log(connectionException);
}
});
graphite.on('connect', function() {
@ -208,7 +208,7 @@ config.configFile(process.argv[2], function (config, oldConfig) {
});
} catch(e){
if (config.debug) {
sys.log(e);
util.log(e);
}
stats['graphite']['last_exception'] = Math.round(new Date().getTime() / 1000);
}

Просмотреть файл

@ -2,7 +2,7 @@ var fs = require('fs'),
net = require('net'),
temp = require('temp'),
spawn = require('child_process').spawn,
sys = require('sys'),
util = require('util'),
urlparse = require('url').parse,
_ = require('underscore'),
dgram = require('dgram'),