зеркало из https://github.com/microsoft/statsd.git
only split the packet if we need to
This commit is contained in:
Родитель
644ec36f83
Коммит
69d4f6af3c
7
stats.js
7
stats.js
|
@ -141,7 +141,12 @@ config.configFile(process.argv[2], function (config, oldConfig) {
|
||||||
server = dgram.createSocket('udp4', function (msg, rinfo) {
|
server = dgram.createSocket('udp4', function (msg, rinfo) {
|
||||||
backendEvents.emit('packet', msg, rinfo);
|
backendEvents.emit('packet', msg, rinfo);
|
||||||
counters[packets_received]++;
|
counters[packets_received]++;
|
||||||
var metrics = msg.toString().split("\n");
|
var packet_data = msg.toString();
|
||||||
|
if (packet_data.indexOf("\n") > -1) {
|
||||||
|
var metrics = packet_data.split("\n");
|
||||||
|
} else {
|
||||||
|
var metrics = [ packet_data ] ;
|
||||||
|
}
|
||||||
|
|
||||||
for (var midx in metrics) {
|
for (var midx in metrics) {
|
||||||
if (config.dumpMessages) {
|
if (config.dumpMessages) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче